public void TestException() { var test = new IP(IPAddress.Any); Assert.Throws<ArgumentNullException>(() => test.AppendBytesTo(null)); Assert.Throws<ArgumentNullException>(() => new IP(new Tuple<int, byte[]>(0, new byte[] { 0 }), null)); Assert.Throws<ArgumentNullException>(() => new IP((IPAddress) null)); Assert.Throws<ArgumentException>(() => new IP(new Tuple<int, byte[]>(1, new byte[] { 1 }), new MemoryStream())); Assert.Throws<FormatException>(() => new IP("test")); }
public void TestException() { var test = new IP(IPAddress.Any); Assert.Throws <ArgumentNullException>(() => test.AppendBytesTo(null)); Assert.Throws <ArgumentNullException>(() => new IP(0, null)); Assert.Throws <ArgumentNullException>(() => new IP((IPAddress)null)); Assert.Throws <ArgumentException>(() => new IP(1, new MemoryStream())); Assert.Throws <ArgumentException>(() => new IP("test")); }
public void TestException() { var test = new IP(IPAddress.Any.GetAddressBytes()); Assert.Throws <ArgumentNullException>(() => test.AppendBytesTo(null)); Assert.Throws <ArgumentNullException>(() => new IP(new Tuple <int, byte[]>(0, new byte[] { 0 }), null)); Assert.Throws <ArgumentNullException>(() => new IP((byte[])null)); Assert.Throws <ArgumentException>(() => new IP(new Tuple <int, byte[]>(1, new byte[] { 1 }), new MemoryStream())); Assert.Throws <FormatException>(() => new IP("test")); Assert.Throws <ArgumentNullException>(() => new IP(null, new MemoryStream())); }