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 void SetDataFromSubTransaction(IVirtualObjectEndPointDataManager sourceDataManager, IRelationEndPointProvider endPointProvider) { ArgumentUtility.CheckNotNull("sourceDataManager", sourceDataManager); ArgumentUtility.CheckNotNull("endPointProvider", endPointProvider); _currentOppositeObject = sourceDataManager.CurrentOppositeObject; if (sourceDataManager.CurrentOppositeEndPoint == null) { _currentOppositeEndPoint = null; } else { _currentOppositeEndPoint = (IRealObjectEndPoint)endPointProvider.GetRelationEndPointWithoutLoading(sourceDataManager.CurrentOppositeEndPoint.ID); Assertion.IsNotNull( _currentOppositeEndPoint, "When committing a current virtual relation value from a sub-transaction, the opposite end-point is guaranteed to exist."); } }
private void SetCompleteState(IVirtualObjectEndPointDataManager dataManager) { _loadState = new CompleteVirtualObjectEndPointLoadState(dataManager, EndPointProvider, _transactionEventSink); }
public void SetDataFromSubTransaction(IVirtualObjectEndPointDataManager sourceDataManager, IRelationEndPointProvider endPointProvider) { throw new NotImplementedException(); }