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()); }
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()); }