namespace MonoTests.System.Net.Sockets
{
[TestFixture]
- [Category ("RequiresBSDSockets")]
public class TcpListenerTest
{
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void TcpListener ()
{
var port = NetworkHelpers.FindFreePort ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void CtorInt1 ()
{
int nex = 0;
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
[ExpectedException (typeof (ArgumentNullException))]
+#endif
public void CtorIPEndPoint ()
{
new TcpListener (null);
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
[ExpectedException (typeof (ArgumentNullException))]
+#endif
public void CtorIPAddressInt1 ()
{
new TcpListener (null, 100000);
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
[ExpectedException (typeof (ArgumentOutOfRangeException))]
+#endif
public void CtorIPAddressInt2 ()
{
new TcpListener (IPAddress.Any, 100000);
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void PreStartStatus ()
{
MyListener listener = new MyListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void PostStartStatus ()
{
MyListener listener = new MyListener ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void StartListenMoreThan5 ()
{
var port = NetworkHelpers.FindFreePort ();