Files
mono/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs
T
Gonzalo Paniagua Javier 1f19ce5b39 2004-06-05 Gonzalo Paniagua Javier <[email protected]>
* SocketTest.cs: added test for Select with empty lists. Changed the
	'bogus' address of EndConnect test.

svn path=/trunk/mcs/; revision=28875
2004-06-05 15:55:37 +00:00

50 lines
1.1 KiB
C#

// System.Net.Sockets.TcpClientTest.cs
//
// Authors:
// Brad Fitzpatrick ([email protected])
//
// (C) Copyright 2003 Brad Fitzpatrick
//
using System;
using System.Collections;
using System.Net;
using System.Net.Sockets;
using NUnit.Framework;
namespace MonoTests.System.Net.Sockets
{
[TestFixture]
public class SocketTest
{
[Test]
public void EndConnect ()
{
IPAddress ipOne = IPAddress.Parse ("192.168.244.244"); // something bogus
IPEndPoint ipEP = new IPEndPoint (ipOne, 23483); // something bogus
Socket sock = new Socket (ipEP.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
IAsyncResult ar = sock.BeginConnect (ipEP, null, null);
bool gotException = false;
try {
sock.EndConnect (ar); // should raise an exception because connect was bogus
} catch {
gotException = true;
}
Assertion.AssertEquals ("A01", gotException, true);
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void SelectEmpty ()
{
ArrayList list = new ArrayList ();
Socket.Select (list, list, list, 1000);
}
}
}