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