public void RaiseIfTwoTransactionChangeTheSameSlot() { IObject obj = new BaseObject(null, new object[] { 1, 2, 3 }); TransactionalValue tvalue = new TransactionalValue(this.trobj, 0); Transaction transaction1 = this.CreateTransaction(); tvalue.SetValue(transaction1, 2); Transaction transaction2 = this.CreateTransaction(); tvalue.SetValue(transaction2, 3); }
public void RaiseIfTransactionChangeACommittedSlot() { IObject obj = new BaseObject(null, new object[] { 1, 2, 3 }); TransactionalValue tvalue = new TransactionalValue(this.trobj, 0); Transaction transaction1 = this.CreateTransaction(); Transaction transaction2 = this.CreateTransaction(); tvalue.SetValue(transaction2, 3); transaction2.Commit(this.manager.Time + 1); ////tvalue.CommitValue(transaction2); tvalue.SetValue(transaction1, 2); }
public void SetAndGetValueInTransaction() { IObject obj = new BaseObject(null, new object[] { 1, 2, 3 }); TransactionalValue tvalue = new TransactionalValue(this.trobj, 2); Transaction transaction = this.CreateTransaction(); tvalue.SetValue(transaction, 2); Assert.AreEqual(2, tvalue.GetValue(transaction)); Assert.AreEqual(3, tvalue.GetValue(0)); }
public void TwoSerializedTransactions() { IObject obj = new BaseObject(null, new object[] { 1, 2, 3 }); TransactionalValue tvalue = new TransactionalValue(this.trobj, 0); Transaction transaction1 = this.CreateTransaction(); tvalue.SetValue(transaction1, 2); tvalue.CommitValue(transaction1); Assert.AreEqual(2, tvalue.GetValue(0)); Transaction transaction2 = this.CreateTransaction(); tvalue.SetValue(transaction2, 3); tvalue.CommitValue(transaction2); Assert.AreEqual(3, tvalue.GetValue(0)); }