mirror of https://github.com/oliverbooth/X10D
test: cover null input for IsIPv4 and IsIPv6
This commit is contained in:
parent
3523ca5468
commit
4fc0d01670
|
@ -29,6 +29,13 @@ public class IPAddressTests
|
||||||
Assert.IsFalse(_ipv6Address.IsIPv4());
|
Assert.IsFalse(_ipv6Address.IsIPv4());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void IsIPv4_ShouldThrowArgumentNullException_GivenNullAddress()
|
||||||
|
{
|
||||||
|
IPAddress address = null!;
|
||||||
|
Assert.ThrowsException<ArgumentNullException>(() => address.IsIPv4());
|
||||||
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void IsIPv6_ShouldBeFalse_GivenIPv4()
|
public void IsIPv6_ShouldBeFalse_GivenIPv4()
|
||||||
{
|
{
|
||||||
|
@ -40,4 +47,11 @@ public class IPAddressTests
|
||||||
{
|
{
|
||||||
Assert.IsTrue(_ipv6Address.IsIPv6());
|
Assert.IsTrue(_ipv6Address.IsIPv6());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void IsIPv6_ShouldThrowArgumentNullException_GivenNullAddress()
|
||||||
|
{
|
||||||
|
IPAddress address = null!;
|
||||||
|
Assert.ThrowsException<ArgumentNullException>(() => address.IsIPv6());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue