public void Perform() { using (_mockRepository.Ordered()) { _decoratedCommandMock.Expect(mock => mock.Perform()); _stateUpdateListenerMock.Expect(mock => mock.VirtualEndPointStateUpdated(_modifiedEndPointID, null)); } _mockRepository.ReplayAll(); _commandDecorator.Perform(); _mockRepository.VerifyAll(); }
public void SetDataFromSubTransaction_UnwrapsSourceEndPoint() { var sourceInnerEndPoint = MockRepository.GenerateStub <ICollectionEndPoint> (); var sourceEndPoint = new StateUpdateRaisingCollectionEndPointDecorator(sourceInnerEndPoint, _listenerMock); _listenerMock.Expect(mock => mock.VirtualEndPointStateUpdated(_endPointID, null)); _listenerMock.Replay(); _innerEndPointMock.BackToRecord(); _innerEndPointMock.Stub(stub => stub.ID).Return(_endPointID); _innerEndPointMock.Stub(stub => stub.HasChangedFast).Return(null); _innerEndPointMock .Expect(ep => ep.SetDataFromSubTransaction(sourceInnerEndPoint)) .WhenCalled(mi => _listenerMock.AssertWasNotCalled(mock => mock.VirtualEndPointStateUpdated(Arg <RelationEndPointID> .Is.Anything, Arg <bool?> .Is.Anything))); _innerEndPointMock.Replay(); _decorator.SetDataFromSubTransaction(sourceEndPoint); _innerEndPointMock.VerifyAllExpectations(); _listenerMock.AssertWasCalled(mock => mock.VirtualEndPointStateUpdated(_endPointID, null)); }