Exemplo n.º 1
0
        public void Timestamped_GetHashCode()
        {
            var ti = new Timestamped <string>(null, new DateTimeOffset());

            Assert.IsTrue(ti.GetHashCode() != 0);
            Assert.AreEqual(ti.GetHashCode(), ti.GetHashCode());

            var t2 = new Timestamped <string>("", new DateTimeOffset());

            Assert.AreNotEqual(ti.GetHashCode(), t2.GetHashCode());
        }
Exemplo n.º 2
0
 /// <summary>
 /// Return the HashCode of this object.
 /// </summary>
 /// <returns>The HashCode of this object.</returns>
 public override Int32 GetHashCode()
 {
     unchecked
     {
         return(_Id.GetHashCode() * 17 ^ _OldStatus.GetHashCode() * 23 ^ _NewStatus.GetHashCode());
     }
 }
Exemplo n.º 3
0
        public void Timestamped_GetHashCode()
        {
            var ti = new Timestamped<string>(null, new DateTimeOffset());
            Assert.True(ti.GetHashCode() != 0);
            Assert.Equal(ti.GetHashCode(), ti.GetHashCode());

            var t2 = new Timestamped<string>("", new DateTimeOffset());
            Assert.NotEqual(ti.GetHashCode(), t2.GetHashCode());
        }