public void CreateVirtualEndPoint_One_MarkDataCompleteFalse() { var endPointID = RelationEndPointID.Create(DomainObjectIDs.Order1, typeof(Order), "OrderTicket"); var endPointStub = MockRepository.GenerateStub <IVirtualObjectEndPoint>(); _endPointFactoryMock .Expect(mock => mock.CreateVirtualObjectEndPoint(endPointID)) .Return(endPointStub); _endPointFactoryMock.Replay(); var result = RelationEndPointFactoryExtensions.CreateVirtualEndPoint(_endPointFactoryMock, endPointID, false); _endPointFactoryMock.VerifyAllExpectations(); Assert.That(result, Is.SameAs(endPointStub)); endPointStub.AssertWasNotCalled(stub => stub.MarkDataComplete(Arg <DomainObject> .Is.Anything)); }
public void RegisterEndPoints() { _agentPartialMock .Stub(stub => stub.MockableGetOwnedEndPointIDs(_orderDataContainer)) .Return(new[] { _orderTicketEndPointID, _customerEndPointID }); _agentPartialMock.Replay(); _endPointFactoryMock.Expect(mock => mock.CreateVirtualObjectEndPoint(_orderTicketEndPointID)).Return(_orderTicketEndPointMock); _endPointFactoryMock.Expect(mock => mock.CreateRealObjectEndPoint(_customerEndPointID, _orderDataContainer)).Return(_customerEndPointStub); _endPointFactoryMock.Replay(); _orderTicketEndPointMock.Expect(mock => mock.MarkDataComplete(null)); _orderTicketEndPointMock.Replay(); _registrationAgentMock.Expect(mock => mock.RegisterEndPoint(_orderTicketEndPointMock, _map)); _registrationAgentMock.Expect(mock => mock.RegisterEndPoint(_customerEndPointStub, _map)); _registrationAgentMock.Replay(); _agentPartialMock.RegisterEndPoints(_orderDataContainer, _map); _endPointFactoryMock.VerifyAllExpectations(); _registrationAgentMock.VerifyAllExpectations(); _orderTicketEndPointMock.VerifyAllExpectations(); }