public void Equality_SamePeerId_DifferentIP() { var one = new Peer("test", new Uri("ipv4://1.1.1.1:1111")); var other = new Peer("test", new Uri("ipv4://2.2.2.2:2222")); Assert.AreEqual(one, other, "#1"); Assert.AreEqual(one.GetHashCode(), other.GetHashCode(), "#2"); }
public void Equality_SamePeerId_SameIP() { var one = new Peer("test", new Uri("ipv4://1.1.1.1:1111")); var otherOne = new Peer("test", new Uri("ipv4://1.1.1.1:1111")); Assert.AreEqual(one, otherOne, "#1"); Assert.AreEqual(one.GetHashCode(), otherOne.GetHashCode(), "#2"); }
public void Equality_EmptyPeerId() { var one = new Peer("", new Uri("ipv4://1.1.1.1:1111")); var other = new Peer("", new Uri("ipv4://1.1.1.1:1111")); Assert.AreEqual(one, other, "#1"); Assert.AreEqual(one.GetHashCode(), other.GetHashCode(), "#2"); }