[Test] public void FromTokenIsNull() { Oid oid = Oid.FromToken("NULL", Meta); Assert.AreEqual(Oid.Null, oid); Assert.AreSame(Oid.Null, oid); Assert.AreEqual(Oid.Null.GetHashCode(), oid.GetHashCode()); }
[Test] public void HashCodeAndEqualTest() { Oid oid = new Oid(Meta.GetAssetType("Story"), 5, null); Oid oid2 = Oid.FromToken("Story:5", Meta); Assert.AreEqual(oid, oid2); Assert.AreEqual(oid.GetHashCode(), oid2.GetHashCode()); }
[Test] public void HashCodeAndEqualWithMomentTest() { Oid oid = new Oid(Meta.GetAssetType("Story"), 5, 555); Oid oid2 = Oid.FromToken("Story:5:555", Meta); Oid anotherOid = Oid.FromToken("Story:5:666", Meta); Oid momentlessOid = Oid.FromToken("Story:5", Meta); Assert.AreEqual(oid, oid2); Assert.AreEqual(oid.GetHashCode(), oid2.GetHashCode()); Assert.AreNotEqual(oid, anotherOid); Assert.AreNotEqual(oid, momentlessOid); Assert.AreNotEqual(momentlessOid, anotherOid); }