mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-09 23:15:40 +00:00
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());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void IsIPv4_ShouldThrowArgumentNullException_GivenNullAddress()
|
||||
{
|
||||
IPAddress address = null!;
|
||||
Assert.ThrowsException<ArgumentNullException>(() => address.IsIPv4());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void IsIPv6_ShouldBeFalse_GivenIPv4()
|
||||
{
|
||||
@ -40,4 +47,11 @@ public class IPAddressTests
|
||||
{
|
||||
Assert.IsTrue(_ipv6Address.IsIPv6());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void IsIPv6_ShouldThrowArgumentNullException_GivenNullAddress()
|
||||
{
|
||||
IPAddress address = null!;
|
||||
Assert.ThrowsException<ArgumentNullException>(() => address.IsIPv6());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user