Ejemplo n.º 1
0
        public override int GetHashCode()
        {
            int hash_1 = V1.GetHashCode();
            int hash_2 = V2.GetHashCode();
            int hash_3 = V3.GetHashCode();
            int hash_4 = V4.GetHashCode();

            return(hash_1 ^ hash_2 ^ hash_3 ^ hash_4);
        }
Ejemplo n.º 2
0
 public override int GetHashCode()
 {
     unchecked {
         int hashCode = (V1 != null ? V1.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (V2 != null ? V2.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (V3 != null ? V3.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (N != null ? N.GetHashCode() : 0);
         return(hashCode);
     }
 }
Ejemplo n.º 3
0
        public void IEquatableImpl()
        {
            var a  = new V2(1, 2);
            var b  = new V2(1, 2);
            var c  = new V2(1, 3);
            var d  = new V2(2, 2);
            var ec = EqualityComparer <V2> .Default;

            Assert.True(ec.Equals(a, b));
            Assert.AreEqual(a.GetHashCode(), b.GetHashCode());
            Assert.False(ec.Equals(a, c));
            Assert.False(ec.Equals(a, d));
            Assert.False(ec.Equals(c, d));
        }
Ejemplo n.º 4
0
 public override int GetHashCode()
 {
     return(V1.GetHashCode() ^ V2.GetHashCode() ^ V3.GetHashCode());
 }