예제 #1
0
        public void localhostを有効にする()
        {
            string ipaddr = "localhost";

            var ip = new CheckIP();

            Assert.AreEqual(true, ip.Check(ipaddr));
            Assert.AreEqual(127, ip.IP1);
            Assert.AreEqual(0, ip.IP2);
            Assert.AreEqual(0, ip.IP3);
            Assert.AreEqual(1, ip.IP4);
            Assert.AreEqual("127.0.0.1", ip.ToString());
        }
예제 #2
0
        public void 途中で空欄があっても大丈夫()
        {
            string ipaddr = "127. 0     .0.1   ";

            var ip = new CheckIP();

            Assert.AreEqual(true, ip.Check(ipaddr));
            Assert.AreEqual(127, ip.IP1);
            Assert.AreEqual(0, ip.IP2);
            Assert.AreEqual(0, ip.IP3);
            Assert.AreEqual(1, ip.IP4);
            Assert.AreEqual("127.0.0.1", ip.ToString());
        }