Exemple #1
0
        public void Invalid()
        {
            //Prepare
            IPAddress IP = IPAddress.Parse("10.0.0.1");
            String    INVALID_CIDR_IP = "192.168.0.0/-1";

            //Act
            var result = NetworkHelpers.IsIpv4AddressInRange(IP, INVALID_CIDR_IP);

            //Assert
            Assert.Fail();
        }
Exemple #2
0
        public void NotOnRange()
        {
            //Prepare
            IPAddress IP      = IPAddress.Parse("10.0.0.1");
            String    CIDR_IP = "192.168.0.0/24";

            //Act
            var result = NetworkHelpers.IsIpv4AddressInRange(IP, CIDR_IP);

            //Assert
            Assert.IsFalse(result);
        }