public void CreateSaveAndHoldValidSavepoint()
 {
     ISavepointManager saveMgr = MockRepository.GenerateMock<ISavepointManager>();
     DefaultTransactionStatus status = new DefaultTransactionStatus(saveMgr, true, false, false, true, new object());
     status.CreateAndHoldSavepoint("savepoint");
     Assert.IsTrue(status.HasSavepoint);
     Assert.AreEqual("savepoint", status.Savepoint);
 }
        public void CreateSaveAndHoldValidSavepoint()
        {
            ISavepointManager        saveMgr = MockRepository.GenerateMock <ISavepointManager>();
            DefaultTransactionStatus status  = new DefaultTransactionStatus(saveMgr, true, false, false, true, new object());

            status.CreateAndHoldSavepoint("savepoint");
            Assert.IsTrue(status.HasSavepoint);
            Assert.AreEqual("savepoint", status.Savepoint);
        }
		public void CreateSaveAndHoldValidSavepoint()
		{
			MyMockTxnObjectSavepointMgr saveMgr = new MyMockTxnObjectSavepointMgr();
			saveMgr.SetSavepointToReturn( "savepoint" );
			DefaultTransactionStatus status = new DefaultTransactionStatus( saveMgr , true, false, false, true, new object());
			status.CreateAndHoldSavepoint( "savepoint" );
			Assert.IsTrue( status.HasSavepoint );
			Assert.AreEqual( "savepoint", status.Savepoint );
		}
Пример #4
0
        public void CreateSaveAndHoldValidSavepoint()
        {
            MyMockTxnObjectSavepointMgr saveMgr = new MyMockTxnObjectSavepointMgr();

            saveMgr.SetSavepointToReturn("savepoint");
            DefaultTransactionStatus status = new DefaultTransactionStatus(saveMgr, true, false, false, true, new object());

            status.CreateAndHoldSavepoint("savepoint");
            Assert.IsTrue(status.HasSavepoint);
            Assert.AreEqual("savepoint", status.Savepoint);
        }
        public void RollbackHeldSavepointSuccess()
        {
            ISavepointManager saveMgr = MockRepository.GenerateMock<ISavepointManager>();
            string savepoint = "savepoint";
            DefaultTransactionStatus status = new DefaultTransactionStatus(saveMgr, true, false, false, true, new object());
            status.CreateAndHoldSavepoint(savepoint);
            Assert.IsTrue(status.HasSavepoint);
            Assert.AreEqual(savepoint, status.Savepoint);

            status.RollbackToHeldSavepoint();
            saveMgr.AssertWasCalled(x => x.RollbackToSavepoint(savepoint));
        }
        public void RollbackHeldSavepointSuccess()
        {
            ISavepointManager        saveMgr   = MockRepository.GenerateMock <ISavepointManager>();
            string                   savepoint = "savepoint";
            DefaultTransactionStatus status    = new DefaultTransactionStatus(saveMgr, true, false, false, true, new object());

            status.CreateAndHoldSavepoint(savepoint);
            Assert.IsTrue(status.HasSavepoint);
            Assert.AreEqual(savepoint, status.Savepoint);

            status.RollbackToHeldSavepoint();
            saveMgr.AssertWasCalled(x => x.RollbackToSavepoint(savepoint));
        }
Пример #7
0
        public void RollbackHeldSavepointSuccess()
        {
            ISavepointManager        saveMgr   = A.Fake <ISavepointManager>();
            string                   savepoint = "savepoint";
            DefaultTransactionStatus status    = new DefaultTransactionStatus(saveMgr, true, false, false, true, new object());

            status.CreateAndHoldSavepoint(savepoint);
            Assert.IsTrue(status.HasSavepoint);
            Assert.AreEqual(savepoint, status.Savepoint);

            status.RollbackToHeldSavepoint();
            A.CallTo(() => saveMgr.RollbackToSavepoint(savepoint)).MustHaveHappened();
        }
		public void RollbackHeldSavepointSuccess()
		{
			MyMockTxnObjectSavepointMgr saveMgr = new MyMockTxnObjectSavepointMgr();
			string savepoint = "savepoint";
			saveMgr.SetExpectedSavepoint( savepoint );
			saveMgr.SetSavepointToReturn( savepoint );
			DefaultTransactionStatus status = new DefaultTransactionStatus( saveMgr , true, false, false, true, new object());
			status.CreateAndHoldSavepoint( savepoint );
			Assert.IsTrue( status.HasSavepoint );
			Assert.AreEqual( savepoint, status.Savepoint );

			status.RollbackToHeldSavepoint();
			saveMgr.Verify();
		}
Пример #9
0
        public void RollbackHeldSavepointSuccess()
        {
            MyMockTxnObjectSavepointMgr saveMgr = new MyMockTxnObjectSavepointMgr();
            string savepoint = "savepoint";

            saveMgr.SetExpectedSavepoint(savepoint);
            saveMgr.SetSavepointToReturn(savepoint);
            DefaultTransactionStatus status = new DefaultTransactionStatus(saveMgr, true, false, false, true, new object());

            status.CreateAndHoldSavepoint(savepoint);
            Assert.IsTrue(status.HasSavepoint);
            Assert.AreEqual(savepoint, status.Savepoint);

            status.RollbackToHeldSavepoint();
            saveMgr.Verify();
        }