public override bool Equals(Object obj) { if (obj == null || GetType() != obj.GetType()) { return(false); } IPAddress_v6 p = (IPAddress_v6)obj; return(this.ToString().CompareTo(p.ToString()) == 0); }
public static void InterfaceDescriptionOption_IPAddress_v6_Test() { byte[] preTab = new byte[] { 0x20, 0x01, 0x0d, 0xb8, 0x85, 0xa3, 0x08, 0xd3, 0x13, 0x19, 0x8a, 0x2e, 0x03, 0x70, 0x73, 0x44, 0x40 }; IPAddress_v6 address = new IPAddress_v6(preTab); Assert.IsNotNull(address); Assert.AreEqual(address.Address, "2001:0db8:85a3:08d3:1319:8a2e:0370:7344"); Assert.AreEqual(address.PrefixLength, 64); Assert.AreEqual(address.ToString(), "2001:0db8:85a3:08d3:1319:8a2e:0370:7344/64"); byte[] postTab = address.ConvertToByte(); Assert.AreEqual(preTab, postTab); }