public void TxnMgr() { TransactionTemplate temp = new TransactionTemplate(); temp.PlatformTransactionManager = A.Fake <IPlatformTransactionManager>(); temp.AfterPropertiesSet(); }
public void TxnMgr() { TransactionTemplate temp = new TransactionTemplate(); temp.PlatformTransactionManager = MockRepository.GenerateMock <IPlatformTransactionManager>(); temp.AfterPropertiesSet(); }
public void TxnMgr() { TransactionTemplate temp = new TransactionTemplate(); temp.PlatformTransactionManager = new MockTxnPlatformMgr(); temp.AfterPropertiesSet(); }
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() { IPlatformTransactionManager mock = MockRepository.GenerateMock<IPlatformTransactionManager>(); TransactionTemplate temp = new TransactionTemplate(mock); temp.AfterPropertiesSet(); Assert.AreEqual(mock, temp.PlatformTransactionManager); Assert.IsNull(temp.Execute(new TransactionDelegate(DummyTransactionMethod))); mock.AssertWasCalled(x => x.GetTransaction(Arg<ITransactionDefinition>.Is.Anything), constraints => constraints.Repeat.Once()); mock.AssertWasCalled(x => x.Commit(Arg<ITransactionStatus>.Is.Anything), constraints => constraints.Repeat.Once()); }
public void NullResult() { IPlatformTransactionManager mock = MockRepository.GenerateMock <IPlatformTransactionManager>(); TransactionTemplate temp = new TransactionTemplate(mock); temp.AfterPropertiesSet(); Assert.AreEqual(mock, temp.PlatformTransactionManager); Assert.IsNull(temp.Execute(new TransactionDelegate(DummyTransactionMethod))); mock.AssertWasCalled(x => x.GetTransaction(Arg <ITransactionDefinition> .Is.Anything), constraints => constraints.Repeat.Once()); mock.AssertWasCalled(x => x.Commit(Arg <ITransactionStatus> .Is.Anything), constraints => constraints.Repeat.Once()); }
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() { IPlatformTransactionManager mock = A.Fake <IPlatformTransactionManager>(); A.CallTo(() => mock.GetTransaction(A <ITransactionDefinition> ._)).Returns(null); TransactionTemplate temp = new TransactionTemplate(mock); temp.AfterPropertiesSet(); Assert.AreEqual(mock, temp.PlatformTransactionManager); Assert.IsNull(temp.Execute(DummyTransactionMethod)); A.CallTo(() => mock.GetTransaction(A <ITransactionDefinition> ._)).MustHaveHappenedOnceExactly(); A.CallTo(() => mock.Commit(A <ITransactionStatus> ._)).MustHaveHappenedOnceExactly(); }
public void NoTxnMgr() { TransactionTemplate temp = new TransactionTemplate(); Assert.Throws <ArgumentException>(() => temp.AfterPropertiesSet()); }
public void NoTxnMgr() { TransactionTemplate temp = new TransactionTemplate(); temp.AfterPropertiesSet(); }
public void TxnMgr() { TransactionTemplate temp = new TransactionTemplate(); temp.PlatformTransactionManager = new MockTxnPlatformMgr(); temp.AfterPropertiesSet(); }
public void NoTxnMgr() { TransactionTemplate temp = new TransactionTemplate(); temp.AfterPropertiesSet(); }
public void TxnMgr() { TransactionTemplate temp = new TransactionTemplate(); temp.PlatformTransactionManager = MockRepository.GenerateMock<IPlatformTransactionManager>(); temp.AfterPropertiesSet(); }
public void NoTxnMgr() { TransactionTemplate temp = new TransactionTemplate(); Assert.Throws<ArgumentException>(() => temp.AfterPropertiesSet()); }