예제 #1
0
		public void NullResult()
		{
			MockTxnPlatformMgr mock = new MockTxnPlatformMgr();
			mock.SetExpectedGetTxnCallCount(1);
			mock.SetExpectedCommitCallCount(1);
			TransactionTemplate temp = new TransactionTemplate(mock);
			temp.AfterPropertiesSet();
			Assert.AreEqual( mock, temp.PlatformTransactionManager);
			Assert.IsNull( temp.Execute(new TransactionDelegate(DummyTransactionMethod) ) );
			mock.Verify();
		}
        public void NullResult()
        {
            MockTxnPlatformMgr mock = new MockTxnPlatformMgr();

            mock.SetExpectedGetTxnCallCount(1);
            mock.SetExpectedCommitCallCount(1);
            TransactionTemplate temp = new TransactionTemplate(mock);

            temp.AfterPropertiesSet();
            Assert.AreEqual(mock, temp.PlatformTransactionManager);
            Assert.IsNull(temp.Execute(new TransactionDelegate(DummyTransactionMethod)));
            mock.Verify();
        }
예제 #3
0
		public void ExecuteException()
		{
			MockTxnPlatformMgr mock = new MockTxnPlatformMgr();
			mock.SetExpectedGetTxnCallCount(1);
			mock.SetExpectedRollbackCallCount(1);
			TransactionTemplate temp = new TransactionTemplate(mock);
			try 
			{
				temp.Execute(new TransactionDelegate(DummyExceptionMethod));
				Assert.Fail("Should throw exception");
			} catch
			{
				
			}
			mock.Verify();
		}
        public void ExecuteException()
        {
            MockTxnPlatformMgr mock = new MockTxnPlatformMgr();

            mock.SetExpectedGetTxnCallCount(1);
            mock.SetExpectedRollbackCallCount(1);
            TransactionTemplate temp = new TransactionTemplate(mock);

            try
            {
                temp.Execute(new TransactionDelegate(DummyExceptionMethod));
                Assert.Fail("Should throw exception");
            } catch
            {
            }
            mock.Verify();
        }