コード例 #1
0
        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);
        }
コード例 #2
0
        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());
        }
コード例 #3
0
        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());
        }
コード例 #4
0
		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();
		}
コード例 #5
0
        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();
        }