public void Dated2GDIDWithISOKey_CreateEquate_1() { var dt = new DateTime(1980, 10, 2, 0, 0, 0, DateTimeKind.Utc); var k1 = new Dated2GDIDWithISOKey(dt, new GDID(10, 20), new GDID(10, 30), "eng"); var k2 = new Dated2GDIDWithISOKey(dt, new GDID(10, 20), new GDID(10, 30), "eNG"); Aver.AreEqual("ENG", k1.ISOCode); Aver.AreEqual("ENG", k2.ISOCode); Aver.AreEqual(1980, k1.DateTime.Year); Aver.AreEqual(10, k1.DateTime.Month); Aver.AreEqual(2, k1.DateTime.Day); Aver.AreEqual(1980, k2.DateTime.Year); Aver.AreEqual(10, k2.DateTime.Month); Aver.AreEqual(2, k2.DateTime.Day); Aver.AreEqual(k1, k2); Aver.IsTrue(k1.Equals(k2)); var o = k2; Aver.IsTrue(k1.Equals(o)); Aver.AreEqual(k1.GetHashCode(), k2.GetHashCode()); Aver.AreEqual(k1.GetDistributedStableHash(), k2.GetDistributedStableHash()); Console.WriteLine(k1.ToString()); }
public void Dated2GDIDWithISOKey_CreateNotEquate_2() { var dt = new DateTime(1980, 10, 2, 0, 0, 0, DateTimeKind.Utc); var k1 = new Dated2GDIDWithISOKey(dt, new GDID(10, 20), new GDID(10, 30), "eng"); var k2 = new Dated2GDIDWithISOKey(dt, new GDID(10, 20), new GDID(10, 30), "fra"); Aver.AreNotEqual(k1, k2); Aver.IsFalse(k1.Equals(k2)); var o = k2; Aver.IsFalse(k1.Equals(o)); Aver.AreNotEqual(k1.GetHashCode(), k2.GetHashCode()); Aver.AreNotEqual(k1.GetDistributedStableHash(), k2.GetDistributedStableHash()); Console.WriteLine(k1.ToString()); }
public void Dated2GDIDWithISOKey_CreateEquate_2() { var dt = new DateTime(1980, 10, 2, 0, 0, 0, DateTimeKind.Utc); var k1 = new Dated2GDIDWithISOKey(dt, new GDID(10, 20), new GDID(10, 30), "ua"); var k2 = new Dated2GDIDWithISOKey(dt, new GDID(10, 20), new GDID(10, 30), "UA"); Assert.AreEqual("UA", k1.ISOCode); Assert.AreEqual("UA", k2.ISOCode); Assert.AreEqual(k1, k2); Assert.IsTrue(k1.Equals(k2)); var o = k2; Assert.IsTrue(k1.Equals(o)); Assert.AreEqual(k1.GetHashCode(), k2.GetHashCode()); Assert.AreEqual(k1.GetDistributedStableHash(), k2.GetDistributedStableHash()); Console.WriteLine(k1.ToString()); }
public void Dated2GDIDWithISOKey_CreateNotEquate_3() { var dt1 = new DateTime(1980, 10, 2, 0, 0, 0, DateTimeKind.Utc); var dt2 = new DateTime(1980, 10, 3, 0, 0, 0, DateTimeKind.Utc); var k1 = new Dated2GDIDWithISOKey(dt1, new GDID(10, 20), new GDID(10, 30), "en"); var k2 = new Dated2GDIDWithISOKey(dt2, new GDID(10, 20), new GDID(10, 30), "en"); Assert.AreNotEqual(k1, k2); Assert.IsFalse(k1.Equals(k2)); var o = k2; Assert.IsFalse(k1.Equals(o)); Assert.AreNotEqual(k1.GetHashCode(), k2.GetHashCode()); Assert.AreNotEqual(k1.GetDistributedStableHash(), k2.GetDistributedStableHash()); Console.WriteLine(k1.ToString()); }