private void InvokeTransactionStrategyPlay() { _childTransactionMock.Stub(stub => stub.EnterScope()).Return(MockRepository.GenerateStub <ITransactionScope> ()); _childTransactionMock.Replay(); _transactionStrategyMock.Stub(stub => stub.OnExecutionPlay(Arg <WxeContext> .Is.NotNull, Arg <IWxeFunctionExecutionListener> .Is.NotNull)) .CallOriginalMethod(OriginalCallOptions.NoExpectation); _transactionStrategyMock.Replay(); _transactionStrategyMock.OnExecutionPlay(_wxeContext, MockRepository.GenerateStub <IWxeFunctionExecutionListener> ()); _transactionStrategyMock.BackToRecord(); _transactionStrategyMock.Replay(); }
public void OnExecutionStop() { _childTransactionMock.Stub(stub => stub.EnterScope()).Return(MockRepository.GenerateStub <ITransactionScope> ()); _mockRepository.ReplayAll(); _strategy.OnExecutionPlay(_context, _executionListenerStub); _childTransactionMock.BackToRecord(); using (_mockRepository.Ordered()) { _childTransactionMock.Stub(stub => stub.Commit()); _executionContextStub.Stub(stub => stub.GetOutParameters()).Return(new object[0]); _childTransactionMock.Stub(stub => stub.EnsureCompatibility(Arg <IEnumerable> .Is.NotNull)); _outerTransactionStrategyMock.Stub(mock => mock.EnsureCompatibility(Arg <IEnumerable> .Is.NotNull)); _childTransactionMock.Expect(mock => mock.Release()); _outerTransactionStrategyMock.Expect(mock => mock.UnregisterChildTransactionStrategy(_strategy)); } _mockRepository.ReplayAll(); _strategy.OnExecutionStop(_context, _executionListenerStub); _mockRepository.VerifyAll(); }