GetHashCode() public method

public GetHashCode ( ) : int
return int
コード例 #1
0
        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");
        }
コード例 #2
0
        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");
        }
コード例 #3
0
        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");
        }