Exemple #1
0
        public void DatedGDIDWithISOKey_CreateEquate_1()
        {
            var dt = new DateTime(1980, 10, 2, 0, 0, 0, DateTimeKind.Utc);

            var k1 = new DatedGDIDWithISOKey(dt, new GDID(10, 20), "eng");
            var k2 = new DatedGDIDWithISOKey(dt, new GDID(10, 20), "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());
        }
Exemple #2
0
        public void DatedGDIDWithISOKey_CreateNotEquate_2()
        {
            var dt = new DateTime(1980, 10, 2, 0, 0, 0, DateTimeKind.Utc);

            var k1 = new DatedGDIDWithISOKey(dt, new GDID(10, 20), "eng");
            var k2 = new DatedGDIDWithISOKey(dt, new GDID(10, 20), "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());
        }
Exemple #3
0
        public void DatedGDIDWithISOKey_CreateEquate_2()
        {
            var dt = new DateTime(1980, 10, 2, 0, 0, 0, DateTimeKind.Utc);

            var k1 = new DatedGDIDWithISOKey(dt, new GDID(10, 20), "ua");
            var k2 = new DatedGDIDWithISOKey(dt, new GDID(10, 20), "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());
        }
Exemple #4
0
        public void DatedGDIDWithISOKey_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 DatedGDIDWithISOKey(dt1, new GDID(10, 20), "en");
            var k2 = new DatedGDIDWithISOKey(dt2, new GDID(10, 20), "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());
        }
Exemple #5
0
        public void DatedGDIDWithISOKey_CreateEquate_2()
        {
            var dt = new DateTime(1980, 10, 2, 0, 0, 0, DateTimeKind.Utc);

            var k1 = new DatedGDIDWithISOKey(dt, new GDID(10, 20), "ua");
            var k2 = new DatedGDIDWithISOKey(dt, new GDID(10, 20), "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());
        }