[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); }
public void NullEqualsTest() { Assert.AreNotEqual(Oid.Null, Oid.FromToken("Story:5", Meta)); Assert.AreNotEqual(Oid.FromToken("Story:5", Meta), Oid.Null); }
[Test] public void InvalidOidTokenBadId() { Oid.FromToken("Story", Meta); }
[Test] public void InvalidOidToken() { Oid o = Oid.FromToken("Blah:5:6", Meta); Assert.AreEqual("Story:5:6", o.Token); }
[Test] public void FromTokenWithMoment() { Oid o = Oid.FromToken("Story:5:6", Meta); Assert.AreEqual("Story:5:6", o.Token); }
[Test] public void FromToken() { Oid o = Oid.FromToken("Story:5", Meta); Assert.AreEqual("Story:5", o.Token); }