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

            Assert.AreEqual(expectedResultAddress, ipAddress);
        }