Преглед на файлове

2005-11-22 Gonzalo Paniagua Javier <[email protected]>

	* IPAddressTest.cs: more tests for the byte[] ctor.


svn path=/trunk/mcs/; revision=53373
Gonzalo Paniagua Javier преди 20 години
родител
ревизия
f4e49fd3e4
променени са 2 файла, в които са добавени 34 реда и са изтрити 0 реда
  1. 4 0
      mcs/class/System/Test/System.Net/ChangeLog
  2. 30 0
      mcs/class/System/Test/System.Net/IPAddressTest.cs

+ 4 - 0
mcs/class/System/Test/System.Net/ChangeLog

@@ -1,3 +1,7 @@
+2005-11-22 Gonzalo Paniagua Javier <[email protected]>
+
+	* IPAddressTest.cs: more tests for the byte[] ctor.
+
 2005-11-17 Gonzalo Paniagua Javier <[email protected]>
 
 	* HttpListenerPrefixCollectionTest.cs:

+ 30 - 0
mcs/class/System/Test/System.Net/IPAddressTest.cs

@@ -322,6 +322,36 @@ public class IPAddressTest
 		Assertion.AssertEquals ("#02", false, new Uri("http://[0:0:0:0::127.1.2.3]/").IsLoopback);
 		Assertion.AssertEquals ("#03", true, new Uri("http://[0:0:0:0::0.0.0.1]/").IsLoopback);
 	}
+
+#if NET_2_0
+	[Test]
+	public void FromBytes3 ()
+	{
+		// This one works in 2.0
+		new IPAddress (new byte [4]);
+	}
+	
+	[Test]
+	[ExpectedException (typeof (ArgumentException))]
+	public void FromBytes4 ()
+	{
+		new IPAddress (new byte [4], 0);
+	}
+#else
+	[Test]
+	[ExpectedException (typeof (ArgumentException))]
+	public void FromBytes1 ()
+	{
+		new IPAddress (new byte [4]);
+	}
+	
+	[Test]
+	[ExpectedException (typeof (ArgumentException))]
+	public void FromBytes2 ()
+	{
+		new IPAddress (new byte [4], 0);
+	}
+#endif
 }
 }