public IVirtualObjectEndPointLoadState LoadEndPointAndGetNewState(IVirtualObjectEndPoint endPoint) { var virtualObjectEndPoint = ArgumentUtility.CheckNotNullAndType <VirtualObjectEndPoint> ("endPoint", endPoint); _lazyLoader.LoadLazyVirtualObjectEndPoint(virtualObjectEndPoint.ID); return(virtualObjectEndPoint._loadState); }
public override void SetUp() { base.SetUp(); _definition = Configuration.GetTypeDefinition(typeof(Order)).GetRelationEndPointDefinition(typeof(Order).FullName + ".OrderTicket"); _virtualObjectEndPointMock = MockRepository.GenerateStrictMock <IVirtualObjectEndPoint> (); _dataManagerMock = MockRepository.GenerateStrictMock <IVirtualObjectEndPointDataManager> (); _dataManagerMock.Stub(stub => stub.EndPointID).Return(RelationEndPointID.Create(DomainObjectIDs.Order1, _definition)); _endPointProviderStub = MockRepository.GenerateStub <IRelationEndPointProvider> (); _transactionEventSinkStub = MockRepository.GenerateStub <IClientTransactionEventSink>(); _loadState = new CompleteVirtualObjectEndPointLoadState(_dataManagerMock, _endPointProviderStub, _transactionEventSinkStub); _relatedObject = DomainObjectMother.CreateFakeObject <OrderTicket> (DomainObjectIDs.OrderTicket1); _relatedEndPointStub = MockRepository.GenerateStub <IRealObjectEndPoint> (); _relatedEndPointStub.Stub(stub => stub.GetDomainObjectReference()).Return(_relatedObject); _relatedEndPointStub.Stub(stub => stub.ObjectID).Return(_relatedObject.ID); _relatedObject2 = DomainObjectMother.CreateFakeObject <OrderTicket> (DomainObjectIDs.OrderTicket2); _relatedEndPointStub2 = MockRepository.GenerateStub <IRealObjectEndPoint> (); _relatedEndPointStub2.Stub(stub => stub.ID).Return(RelationEndPointID.Create(_relatedObject2.ID, typeof(OrderTicket), "Order")); _relatedEndPointStub2.Stub(stub => stub.GetDomainObjectReference()).Return(_relatedObject2); _relatedEndPointStub2.Stub(stub => stub.ObjectID).Return(_relatedObject2.ID); _owningObject = DomainObjectMother.CreateFakeObject <Order> (); }
public StateUpdateRaisingVirtualObjectEndPointDecorator(IVirtualObjectEndPoint innerEndPoint, IVirtualEndPointStateUpdateListener listener) { ArgumentUtility.CheckNotNull("innerEndPoint", innerEndPoint); ArgumentUtility.CheckNotNull("listener", listener); _innerEndPoint = innerEndPoint; _listener = listener; }
private void ExpectGetEndPoint( ObjectID objectID, IRelationEndPointDefinition endPointDefinition, IVirtualEndPointProvider virtualEndPointProviderMock, IVirtualObjectEndPoint virtualObjectEndPointMock, bool expectedIsDataComplete) { var relationEndPointID = RelationEndPointID.Create(objectID, endPointDefinition); virtualEndPointProviderMock.Expect(mock => mock.GetOrCreateVirtualEndPoint(relationEndPointID)).Return(virtualObjectEndPointMock); virtualObjectEndPointMock.Expect(mock => mock.IsDataComplete).Return(expectedIsDataComplete); }
public override void SetUp() { base.SetUp(); _endPointID = RelationEndPointID.Create(DomainObjectIDs.Order1, typeof(Order), "OrderTicket"); _listenerMock = MockRepository.GenerateStrictMock <IVirtualEndPointStateUpdateListener> (); _innerEndPointMock = MockRepository.GenerateStrictMock <IVirtualObjectEndPoint> (); _innerEndPointMock.Stub(stub => stub.HasChanged).Return(false); _innerEndPointMock.Stub(stub => stub.ID).Return(_endPointID); _decorator = new StateUpdateRaisingVirtualObjectEndPointDecorator(_innerEndPointMock, _listenerMock); _decoratorTestHelper = new DecoratorTestHelper <IVirtualObjectEndPoint> (_decorator, _innerEndPointMock); }
public override void SetUp() { base.SetUp(); _endPointID = RelationEndPointID.Create(DomainObjectIDs.Order1, typeof(Order), "OrderTicket"); _virtualObjectEndPointMock = MockRepository.GenerateStrictMock <IVirtualObjectEndPoint> (); _endPointLoaderMock = MockRepository.GenerateStrictMock <IncompleteVirtualObjectEndPointLoadState.IEndPointLoader> (); _dataManagerFactoryStub = MockRepository.GenerateStub <IVirtualObjectEndPointDataManagerFactory> (); var dataManagerStub = MockRepository.GenerateStub <IVirtualObjectEndPointDataManager> (); dataManagerStub.Stub(stub => stub.HasDataChanged()).Return(false); _loadState = new IncompleteVirtualObjectEndPointLoadState(_endPointLoaderMock, _dataManagerFactoryStub); _relatedObject = DomainObjectMother.CreateFakeObject <OrderTicket> (); _relatedEndPointStub = MockRepository.GenerateStub <IRealObjectEndPoint> (); _relatedEndPointStub.Stub(stub => stub.ObjectID).Return(_relatedObject.ID); _relatedObject2 = DomainObjectMother.CreateFakeObject <OrderTicket> (); _relatedEndPointStub2 = MockRepository.GenerateStub <IRealObjectEndPoint> (); _relatedEndPointStub2.Stub(stub => stub.ObjectID).Return(_relatedObject2.ID); }
public override void SetUp() { base.SetUp(); _endPointFactoryMock = MockRepository.GenerateStrictMock <IRelationEndPointFactory>(); _registrationAgentMock = MockRepository.GenerateStrictMock <IRelationEndPointRegistrationAgent>(); _agentPartialMock = MockRepository.GeneratePartialMock <TestableDataContainerEndPointsRegistrationAgentBase> ( _endPointFactoryMock, _registrationAgentMock); _map = new RelationEndPointMap(MockRepository.GenerateStub <IClientTransactionEventSink> ()); _orderTicketEndPointID = RelationEndPointID.Create(DomainObjectIDs.Order1, typeof(Order), "OrderTicket"); _customerEndPointID = RelationEndPointID.Create(DomainObjectIDs.Order1, typeof(Order), "Customer"); _orderTicketEndPointMock = MockRepository.GenerateStrictMock <IVirtualObjectEndPoint>(); _orderTicketEndPointMock.Stub(stub => stub.ID).Return(_orderTicketEndPointID); _customerEndPointStub = MockRepository.GenerateStrictMock <IRealObjectEndPoint>(); _customerEndPointStub.Stub(stub => stub.ID).Return(_customerEndPointID); _orderDataContainer = DataContainer.CreateNew(DomainObjectIDs.Order1); }
public StateUpdateRaisingVirtualObjectEndPointDecorator(FlattenedDeserializationInfo info) { _innerEndPoint = info.GetValue <IVirtualObjectEndPoint>(); _listener = info.GetValueForHandle <IVirtualEndPointStateUpdateListener>(); }
public ConstantChangeStateAsserter(IVirtualObjectEndPoint innerEndPoint) { _changeStateBefore = innerEndPoint.HasChanged; _innerEndPoint = innerEndPoint; }