public override void SetUp() { base.SetUp(); _owningOrder = DomainObjectIDs.Order1.GetObject <Order> (); _endPointID = RelationEndPointID.Resolve(_owningOrder, o => o.OrderItems); _collectionEndPointMock = MockRepository.GenerateStrictMock <ICollectionEndPoint>(); StubCollectionEndPoint(_collectionEndPointMock, TestableClientTransaction, _owningOrder); _virtualEndPointProviderStub = MockRepository.GenerateStub <IVirtualEndPointProvider> (); _virtualEndPointProviderStub .Stub(stub => stub.GetOrCreateVirtualEndPoint(_endPointID)) .Return(_collectionEndPointMock); _endPointDataStub = MockRepository.GenerateStub <IDomainObjectCollectionData>(); _endPointDataDecorator = new ReadOnlyCollectionDataDecorator(_endPointDataStub); _commandStub = MockRepository.GenerateStub <IDataManagementCommand>(); _nestedCommandMock = MockRepository.GenerateMock <IDataManagementCommand> (); _nestedCommandMock.Stub(stub => stub.GetAllExceptions()).Return(new Exception[0]); _expandedCommandFake = new ExpandedCommand(_nestedCommandMock); _delegatingData = new EndPointDelegatingCollectionData(_endPointID, _virtualEndPointProviderStub); _orderItem1 = DomainObjectIDs.OrderItem1.GetObject <OrderItem>(); _orderItem2 = DomainObjectIDs.OrderItem2.GetObject <OrderItem>(); ClientTransactionScope.EnterNullScope(); // no active transaction }
public override void SetUp() { base.SetUp(); _virtualEndPointProviderStub = MockRepository.GenerateStub <IVirtualEndPointProvider>(); _factory = new AssociatedCollectionDataStrategyFactory(_virtualEndPointProviderStub); }
public override void SetUp() { base.SetUp(); _virtualEndPointProviderMock = MockRepository.GenerateStrictMock <IVirtualEndPointProvider> (); _map = new RelationEndPointMap(MockRepository.GenerateStub <IClientTransactionEventSink> ()); _agent = new RootRelationEndPointRegistrationAgent(_virtualEndPointProviderMock); }
private void ExpectGetEndPoint( ObjectID objectID, IRelationEndPointDefinition endPointDefinition, IVirtualEndPointProvider relationEndPointProviderMock, ICollectionEndPoint collectionEndPointMock, bool expectedIsDataComplete) { var relationEndPointID = RelationEndPointID.Create(objectID, endPointDefinition); relationEndPointProviderMock.Expect(mock => mock.GetOrCreateVirtualEndPoint(relationEndPointID)).Return(collectionEndPointMock); collectionEndPointMock.Expect(mock => mock.IsDataComplete).Return(expectedIsDataComplete); }
public EndPointDelegatingCollectionData(RelationEndPointID endPointID, IVirtualEndPointProvider virtualEndPointProvider) { ArgumentUtility.CheckNotNull("endPointID", endPointID); ArgumentUtility.CheckNotNull("virtualEndPointProvider", virtualEndPointProvider); if (endPointID.Definition.Cardinality != CardinalityType.Many) { throw new ArgumentException("Associated end-point must be a CollectionEndPoint.", "endPointID"); } _endPointID = endPointID; _virtualEndPointProvider = virtualEndPointProvider; }
public override void SetUp() { base.SetUp(); _endPointProviderMock = MockRepository.GenerateStrictMock <IVirtualEndPointProvider> (); _map = new RelationEndPointMap(MockRepository.GenerateStub <IClientTransactionEventSink> ()); _realOneManyEndPointID = RelationEndPointID.Create(DomainObjectIDs.OrderItem1, typeof(OrderItem), "Order"); _virtualEndPointID = RelationEndPointID.Create(DomainObjectIDs.Order1, typeof(Order), "OrderItems"); _unidirectionalEndPointID = RelationEndPointID.Create(DomainObjectIDs.Location1, typeof(Location), "Client"); _agent = new RelationEndPointRegistrationAgent(_endPointProviderMock); }
public override void SetUp() { base.SetUp(); _mockRepository = new MockRepository(); _virtualEndPointProviderMock = _mockRepository.StrictMock <IVirtualEndPointProvider> (); _state = new UnknownRealObjectEndPointSyncState(_virtualEndPointProviderMock); _endPointID = RelationEndPointID.Create(DomainObjectIDs.Order1, typeof(Order), "Customer"); _endPointMock = _mockRepository.StrictMock <IRealObjectEndPoint> (); _endPointMock.Stub(stub => stub.ID).Return(_endPointID); _endPointMock.Stub(stub => stub.Definition).Return(_endPointID.Definition); _endPointMock.Stub(stub => stub.OppositeObjectID).Return(DomainObjectIDs.Customer1); _oppositeEndPointMock = _mockRepository.StrictMock <IVirtualEndPoint>(); }
public override void SetUp() { base.SetUp(); _virtualEndPointProviderMock = MockRepository.GenerateStrictMock <IVirtualEndPointProvider> (); _agent = new FetchedCollectionRelationDataRegistrationAgent(_virtualEndPointProviderMock); _originatingCustomer1 = DomainObjectMother.CreateFakeObject <Customer> (DomainObjectIDs.Customer1); _originatingCustomer2 = DomainObjectMother.CreateFakeObject <Customer> (DomainObjectIDs.Customer2); _originatingCustomerData1 = LoadedObjectDataObjectMother.CreateLoadedObjectDataStub(_originatingCustomer1); _originatingCustomerData2 = LoadedObjectDataObjectMother.CreateLoadedObjectDataStub(_originatingCustomer2); _fetchedOrder1 = DomainObjectMother.CreateFakeObject <Order> (DomainObjectIDs.Order1); _fetchedOrder2 = DomainObjectMother.CreateFakeObject <Order> (DomainObjectIDs.Order3); _fetchedOrder3 = DomainObjectMother.CreateFakeObject <Order> (DomainObjectIDs.Order4); _fetchedOrderData1 = CreateFetchedOrderData(_fetchedOrder1, _originatingCustomer1.ID); _fetchedOrderData2 = CreateFetchedOrderData(_fetchedOrder2, _originatingCustomer2.ID); _fetchedOrderData3 = CreateFetchedOrderData(_fetchedOrder3, _originatingCustomer1.ID); }
public override void SetUp() { base.SetUp(); _loadedDataContainerProviderStub = MockRepository.GenerateStub <ILoadedDataContainerProvider> (); _virtualEndPointProviderMock = MockRepository.GenerateStrictMock <IVirtualEndPointProvider> (); _agent = new FetchedVirtualObjectRelationDataRegistrationAgent(_virtualEndPointProviderMock); _originatingEmployee1 = DomainObjectMother.CreateFakeObject <Employee> (DomainObjectIDs.Employee1); _originatingEmployee2 = DomainObjectMother.CreateFakeObject <Employee> (DomainObjectIDs.Employee2); _originatingEmployeeData1 = LoadedObjectDataObjectMother.CreateLoadedObjectDataStub(_originatingEmployee1); _originatingEmployeeData2 = LoadedObjectDataObjectMother.CreateLoadedObjectDataStub(_originatingEmployee2); _fetchedComputer1 = DomainObjectMother.CreateFakeObject <Computer> (DomainObjectIDs.Computer1); _fetchedComputer2 = DomainObjectMother.CreateFakeObject <Computer> (DomainObjectIDs.Computer2); _fetchedComputer3 = DomainObjectMother.CreateFakeObject <Computer> (DomainObjectIDs.Computer3); _fetchedComputerData1 = CreateFetchedComputerData(_fetchedComputer1, _originatingEmployee1.ID); _fetchedComputerData2 = CreateFetchedComputerData(_fetchedComputer2, _originatingEmployee2.ID); _fetchedComputerData3 = CreateFetchedComputerData(_fetchedComputer3, DomainObjectIDs.Employee3); }
public FetchedVirtualObjectRelationDataRegistrationAgent(IVirtualEndPointProvider virtualEndPointProvider) { ArgumentUtility.CheckNotNull("virtualEndPointProvider", virtualEndPointProvider); _virtualEndPointProvider = virtualEndPointProvider; }
public RootRelationEndPointRegistrationAgent(IVirtualEndPointProvider endPointProvider) : base(endPointProvider) { }
public UnknownRealObjectEndPointSyncState(FlattenedDeserializationInfo info) { ArgumentUtility.CheckNotNull("info", info); _virtualEndPointProvider = info.GetValueForHandle <IRelationEndPointProvider>(); }
public UnknownRealObjectEndPointSyncState(IVirtualEndPointProvider virtualEndPointProvider) { ArgumentUtility.CheckNotNull("virtualEndPointProvider", virtualEndPointProvider); _virtualEndPointProvider = virtualEndPointProvider; }
public AssociatedCollectionDataStrategyFactory(IVirtualEndPointProvider virtualEndPointProvider) { ArgumentUtility.CheckNotNull("virtualEndPointProvider", virtualEndPointProvider); _virtualEndPointProvider = virtualEndPointProvider; }
public RelationEndPointRegistrationAgent(IVirtualEndPointProvider virtualEndPointProvider) { ArgumentUtility.CheckNotNull("virtualEndPointProvider", virtualEndPointProvider); _virtualEndPointProvider = virtualEndPointProvider; }