Example #1
0
 public void WhenCalledWithInvalidIpAddressFormatShouldThrowException(string invalidIpAddress)
 {
     Assert.Throws <ArgumentException>(() =>
     {
         IpAddressHelper.Ipv4FromString(invalidIpAddress);
     });
 }
Example #2
0
 public void WhenCalledWithValidIpAddressShouldReturnLongThatIsNotNull(string validIpAddress)
 {
     Assert.DoesNotThrow(() =>
     {
         long address = IpAddressHelper.Ipv4FromString(validIpAddress);
         Assert.IsNotNull(address);
     });
 }
Example #3
0
        public void WhenCalledWithValidIpAddressShouldReturnValidInt64Representation(string validIpAddress, long expectedResultAddress)
        {
            long ipAddress = IpAddressHelper.Ipv4FromString(validIpAddress);

            Assert.AreEqual(expectedResultAddress, ipAddress);
        }