public void DefaultConstructorTests() { ISmartTransactionObject txn = A.Fake <ISmartTransactionObject>(); DefaultTransactionStatus stat = new DefaultTransactionStatus(txn, true, false, false, true, new object()); Assert.IsNotNull(stat.Transaction); Assert.IsTrue(!stat.ReadOnly); Assert.IsTrue(!stat.NewSynchronization); Assert.IsNotNull(stat.SuspendedResources); Assert.IsTrue(stat.IsNewTransaction); Assert.IsTrue(!stat.RollbackOnly); stat.SetRollbackOnly(); Assert.IsTrue(stat.RollbackOnly); }
public void DefaultConstructorTests() { ISmartTransactionObject txn = MockRepository.GenerateMock<ISmartTransactionObject>(); DefaultTransactionStatus stat = new DefaultTransactionStatus(txn, true, false, false, true, new object()); Assert.IsNotNull(stat.Transaction); Assert.IsTrue(!stat.ReadOnly); Assert.IsTrue(!stat.NewSynchronization); Assert.IsNotNull(stat.SuspendedResources); Assert.IsTrue(stat.IsNewTransaction); Assert.IsTrue(! stat.RollbackOnly); stat.SetRollbackOnly(); Assert.IsTrue(stat.RollbackOnly); txn.AssertWasCalled(x => x.RollbackOnly, constraints => constraints.Repeat.Once()); }
public void DefaultConstructorTests() { ISmartTransactionObject txn = MockRepository.GenerateMock <ISmartTransactionObject>(); DefaultTransactionStatus stat = new DefaultTransactionStatus(txn, true, false, false, true, new object()); Assert.IsNotNull(stat.Transaction); Assert.IsTrue(!stat.ReadOnly); Assert.IsTrue(!stat.NewSynchronization); Assert.IsNotNull(stat.SuspendedResources); Assert.IsTrue(stat.IsNewTransaction); Assert.IsTrue(!stat.RollbackOnly); stat.SetRollbackOnly(); Assert.IsTrue(stat.RollbackOnly); txn.AssertWasCalled(x => x.RollbackOnly, constraints => constraints.Repeat.Once()); }
public void DefaultConstructorTests() { MyMockTxnObject txn = new MyMockTxnObject(); txn.SetExpectedIsRollBackOnlyValue( false ); txn.SetExpectedRollbackOnlyCalls( 1 ); DefaultTransactionStatus stat = new DefaultTransactionStatus( txn, true, false, false, true, new object() ); Assert.IsNotNull( stat.Transaction ); Assert.IsTrue( !stat.ReadOnly ); Assert.IsTrue( !stat.NewSynchronization ); Assert.IsNotNull( stat.SuspendedResources ); Assert.IsTrue( stat.IsNewTransaction ); Assert.IsTrue( ! stat.RollbackOnly ); stat.SetRollbackOnly(); Assert.IsTrue( stat.RollbackOnly ); txn.Verify(); }
public void DefaultConstructorTests() { MyMockTxnObject txn = new MyMockTxnObject(); txn.SetExpectedIsRollBackOnlyValue(false); txn.SetExpectedRollbackOnlyCalls(1); DefaultTransactionStatus stat = new DefaultTransactionStatus(txn, true, false, false, true, new object()); Assert.IsNotNull(stat.Transaction); Assert.IsTrue(!stat.ReadOnly); Assert.IsTrue(!stat.NewSynchronization); Assert.IsNotNull(stat.SuspendedResources); Assert.IsTrue(stat.IsNewTransaction); Assert.IsTrue(!stat.RollbackOnly); stat.SetRollbackOnly(); Assert.IsTrue(stat.RollbackOnly); txn.Verify(); }