diff --git a/X10D.Tests/src/Net/IPAddressTests.cs b/X10D.Tests/src/Net/IPAddressTests.cs index ac86bf6..443d6fb 100644 --- a/X10D.Tests/src/Net/IPAddressTests.cs +++ b/X10D.Tests/src/Net/IPAddressTests.cs @@ -29,6 +29,13 @@ public class IPAddressTests Assert.IsFalse(_ipv6Address.IsIPv4()); } + [TestMethod] + public void IsIPv4_ShouldThrowArgumentNullException_GivenNullAddress() + { + IPAddress address = null!; + Assert.ThrowsException(() => 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(() => address.IsIPv6()); + } }