Exemple #1
0
 public void CurrentStatusTest()
 {
     int id = 0;
     Transaction target = new Transaction(id, id);
     Enumerations.Status expected = Enumerations.Status.Active;
     Enumerations.Status actual = target.CurrentStatus;
     Assert.AreEqual(expected, actual);
     actual = target.CurrentStatus = expected = Enumerations.Status.Aborted;
     Assert.AreEqual(expected, actual);
     actual = target.CurrentStatus = expected = Enumerations.Status.Committed;
     Assert.AreEqual(expected, actual);
     actual = target.CurrentStatus = expected = Enumerations.Status.Waiting;
     Assert.AreEqual(expected, actual);
 }
Exemple #2
0
        public void TransactionConstructorTest()
        {
            int id = 0;
            int timeStamp = 1;
            Transaction target = new Transaction(id, timeStamp);
            Assert.AreEqual(0, target.Id);
            Assert.AreEqual(Enumerations.Status.Active, target.CurrentStatus);
            Assert.AreEqual(timeStamp, target.TimeStamp);
            Assert.IsFalse(target.ReadOnly);

            target = new Transaction(id, timeStamp, true);
            Assert.AreEqual(0, target.Id);
            Assert.AreEqual(Enumerations.Status.Active, target.CurrentStatus);
            Assert.AreEqual(timeStamp, target.TimeStamp);
            Assert.IsTrue(target.ReadOnly);
        }