public void TestIgniteGuid()
        {
            var guid = Guid.NewGuid();

            var id1 = new IgniteGuid(guid, 1);
            var id2 = new IgniteGuid(guid, 1);
            var id3 = new IgniteGuid(guid, 2);
            var id4 = new IgniteGuid(Guid.NewGuid(), 2);

            // Properties.
            Assert.AreEqual(guid, id1.GlobalId);
            Assert.AreEqual(1, id1.LocalId);
            Assert.AreEqual(id1.GetHashCode(), id2.GetHashCode());

            // Equality.
            Assert.AreEqual(id1, id2);
            Assert.IsTrue(id1 == id2);
            Assert.IsFalse(id1 != id2);

            // Inequality.
            Assert.AreNotEqual(id1, id3);
            Assert.IsFalse(id1 == id3);
            Assert.IsTrue(id1 != id3);

            Assert.AreNotEqual(id4, id3);
            Assert.IsFalse(id4 == id3);
            Assert.IsTrue(id4 != id3);
        }
Beispiel #2
0
 /** <inheritDoc /> */
 public override int GetHashCode()
 {
     return(_id.GetHashCode());
 }