Example #1
0
        [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());
        }
Example #2
0
        [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());
        }
Example #3
0
        [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);
        }
Example #4
0
 public void NullEqualsTest()
 {
     Assert.AreNotEqual(Oid.Null, Oid.FromToken("Story:5", Meta));
     Assert.AreNotEqual(Oid.FromToken("Story:5", Meta), Oid.Null);
 }
Example #5
0
 [Test] public void InvalidOidTokenBadId()
 {
     Oid.FromToken("Story", Meta);
 }
Example #6
0
        [Test] public void InvalidOidToken()
        {
            Oid o = Oid.FromToken("Blah:5:6", Meta);

            Assert.AreEqual("Story:5:6", o.Token);
        }
Example #7
0
        [Test] public void FromTokenWithMoment()
        {
            Oid o = Oid.FromToken("Story:5:6", Meta);

            Assert.AreEqual("Story:5:6", o.Token);
        }
Example #8
0
        [Test] public void FromToken()
        {
            Oid o = Oid.FromToken("Story:5", Meta);

            Assert.AreEqual("Story:5", o.Token);
        }