Exemplo n.º 1
0
        public void Perform__NonCollectible()
        {
            _endPointMock1.Expect(mock => mock.MarkDataIncomplete());
            _endPointMock1.Stub(stub => stub.CanBeCollected).Return(false);

            _endPointMock2.Expect(mock => mock.MarkDataIncomplete());
            _endPointMock2.Stub(stub => stub.CanBeCollected).Return(false);
            _mockRepository.ReplayAll();

            _command.Perform();

            _mockRepository.VerifyAll();
        }
        public void MarkDataIncomplete_RaisesEvent()
        {
            var endPointID = RelationEndPointObjectMother.CreateRelationEndPointID(DomainObjectIDs.Order1, "OrderItems");

            _virtualEndPointMock
            .Stub(stub => stub.ID)
            .Return(endPointID);
            _virtualEndPointMock.Replay();

            _dataManagerMock.Stub(stub => stub.HasDataChanged()).Return(false);
            _dataManagerMock.Replay();

            _loadState.StubOriginalOppositeEndPoints(new IRealObjectEndPoint[0]);

            _transactionEventSinkWithMock.Expect(mock => mock.RaiseRelationEndPointBecomingIncompleteEvent(endPointID));
            _transactionEventSinkWithMock.Replay();

            _loadState.MarkDataIncomplete(_virtualEndPointMock, () => { });

            _virtualEndPointMock.VerifyAllExpectations();
            _dataManagerMock.VerifyAllExpectations();
            _transactionEventSinkWithMock.VerifyAllExpectations();
        }