Exemplo n.º 1
0
        public void VerifyJetCommitIdIncomparable()
        {
            DateTime      d         = DateTime.Now;
            JET_COMMIT_ID commitId1 = DurableCommitTests.CreateJetCommitId(1, d, "computer", 3);
            JET_COMMIT_ID commitId2 = DurableCommitTests.CreateJetCommitId(2, d, "computer", 3);

            Assert.IsTrue(commitId1.GetHashCode() != commitId2.GetHashCode());
            Assert.IsFalse(commitId1 == commitId2);
        }
        public void JetCommitIdToString()
        {
            DateTime      d         = DateTime.Now;
            JET_COMMIT_ID commitId  = DurableCommitTests.CreateJetCommitId(1, d, "computer", 2);
            var           signature = new JET_SIGNATURE(1, d, "computer");

            string sigString = signature.ToString();
            string expected  = string.Format(
                CultureInfo.InvariantCulture,
                string.Format("JET_COMMIT_ID({0}:2", sigString));

            Assert.AreEqual(expected, commitId.ToString());
        }
Exemplo n.º 3
0
        public void VerifyJetCommitIdEquality()
        {
            DateTime      d         = DateTime.Now;
            JET_COMMIT_ID commitId1 = DurableCommitTests.CreateJetCommitId(1, d, "computer", 2);
            JET_COMMIT_ID commitId2 = DurableCommitTests.CreateJetCommitId(1, d, "computer", 2);

            Assert.IsTrue(commitId1 == commitId2);
            Assert.IsTrue(commitId1.GetHashCode() == commitId2.GetHashCode());
            Assert.IsTrue(commitId1.Equals(commitId2));
            Assert.IsFalse(commitId1 != commitId2);
            Assert.IsTrue(commitId1 <= commitId2);
            Assert.IsFalse(commitId1 < commitId2);
            Assert.IsTrue(commitId1 >= commitId2);
            Assert.IsFalse(commitId1 > commitId2);
        }