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(); }
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(); }