示例#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());
        }
示例#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());
        }
示例#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);
        }
		[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);
        }
		[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());
		}