Ejemplo n.º 1
0
        public RelationEndPointFactory(
            ClientTransaction clientTransaction,
            IRelationEndPointProvider endPointProvider,
            ILazyLoader lazyLoader,
            IClientTransactionEventSink transactionEventSink,
            IVirtualObjectEndPointDataManagerFactory virtualObjectEndPointDataManagerFactory,
            ICollectionEndPointDataManagerFactory collectionEndPointDataManagerFactory,
            ICollectionEndPointCollectionProvider collectionEndPointCollectionProvider,
            IAssociatedCollectionDataStrategyFactory associatedCollectionDataStrategyFactory)
        {
            ArgumentUtility.CheckNotNull("clientTransaction", clientTransaction);
            ArgumentUtility.CheckNotNull("endPointProvider", endPointProvider);
            ArgumentUtility.CheckNotNull("lazyLoader", lazyLoader);
            ArgumentUtility.CheckNotNull("transactionEventSink", transactionEventSink);
            ArgumentUtility.CheckNotNull("virtualObjectEndPointDataManagerFactory", virtualObjectEndPointDataManagerFactory);
            ArgumentUtility.CheckNotNull("collectionEndPointDataManagerFactory", collectionEndPointDataManagerFactory);
            ArgumentUtility.CheckNotNull("collectionEndPointCollectionProvider", collectionEndPointCollectionProvider);
            ArgumentUtility.CheckNotNull("associatedCollectionDataStrategyFactory", associatedCollectionDataStrategyFactory);

            _clientTransaction    = clientTransaction;
            _endPointProvider     = endPointProvider;
            _lazyLoader           = lazyLoader;
            _transactionEventSink = transactionEventSink;
            _virtualObjectEndPointDataManagerFactory = virtualObjectEndPointDataManagerFactory;
            _collectionEndPointDataManagerFactory    = collectionEndPointDataManagerFactory;
            _collectionEndPointCollectionProvider    = collectionEndPointCollectionProvider;
            _associatedCollectionDataStrategyFactory = associatedCollectionDataStrategyFactory;
        }
Ejemplo n.º 2
0
        public CollectionEndPointCollectionManager(
            RelationEndPointID endPointID,
            ICollectionEndPointCollectionProvider collectionProvider,
            IAssociatedCollectionDataStrategyFactory dataStrategyFactory)
        {
            ArgumentUtility.CheckNotNull("endPointID", endPointID);
            ArgumentUtility.CheckNotNull("collectionProvider", collectionProvider);
            ArgumentUtility.CheckNotNull("dataStrategyFactory", dataStrategyFactory);

            _endPointID          = endPointID;
            _collectionProvider  = collectionProvider;
            _dataStrategyFactory = dataStrategyFactory;
        }
Ejemplo n.º 3
0
        public override void SetUp()
        {
            base.SetUp();

            _collectionProviderMock = MockRepository.GenerateStrictMock <ICollectionEndPointCollectionProvider>();
            _associatedCollectionDataStrategyFactoryMock = MockRepository.GenerateStrictMock <IAssociatedCollectionDataStrategyFactory>();
            _endPointID = RelationEndPointID.Create(DomainObjectIDs.Customer1, typeof(Customer), "Orders");

            _manager = new CollectionEndPointCollectionManager(_endPointID, _collectionProviderMock, _associatedCollectionDataStrategyFactoryMock);

            _associatedDataStrategyStub = MockRepository.GenerateStub <IDomainObjectCollectionData> ();
            _associatedDataStrategyStub.Stub(stub => stub.RequiredItemType).Return(typeof(Order));
            _associatedDataStrategyStub.Stub(stub => stub.AssociatedEndPointID).Return(_endPointID);
        }
Ejemplo n.º 4
0
        public override void SetUp()
        {
            base.SetUp();

            _clientTransaction        = ClientTransaction.CreateRootTransaction();
            _endPointProviderStub     = MockRepository.GenerateStub <IRelationEndPointProvider> ();
            _lazyLoaderStub           = MockRepository.GenerateStub <ILazyLoader> ();
            _transactionEventSinkStub = MockRepository.GenerateStub <IClientTransactionEventSink>();

            var virtualObjectEndPointDataManager = MockRepository.GenerateStub <IVirtualObjectEndPointDataManager> ();

            virtualObjectEndPointDataManager.Stub(stub => stub.OriginalOppositeEndPoint).Return(null);
            _virtualObjectEndPointDataManagerFactoryStub = MockRepository.GenerateStub <IVirtualObjectEndPointDataManagerFactory> ();
            _virtualObjectEndPointDataManagerFactoryStub
            .Stub(stub => stub.CreateEndPointDataManager(Arg <RelationEndPointID> .Is.Anything))
            .Return(virtualObjectEndPointDataManager);

            var collectionEndPointDataManager = MockRepository.GenerateStub <ICollectionEndPointDataManager> ();

            collectionEndPointDataManager.Stub(stub => stub.OriginalOppositeEndPoints).Return(new IRealObjectEndPoint[0]);
            _collectionEndPointDataManagerFactoryStub = MockRepository.GenerateStub <ICollectionEndPointDataManagerFactory> ();
            _collectionEndPointDataManagerFactoryStub
            .Stub(stub => stub.CreateEndPointDataManager(Arg <RelationEndPointID> .Is.Anything))
            .Return(collectionEndPointDataManager);

            _collectionEndPointCollectionProviderStub = MockRepository.GenerateStub <ICollectionEndPointCollectionProvider>();
            _associatedCollectionStrategyFactoryStub  = MockRepository.GenerateStub <IAssociatedCollectionDataStrategyFactory>();

            _factory = new RelationEndPointFactory(
                _clientTransaction,
                _endPointProviderStub,
                _lazyLoaderStub,
                _transactionEventSinkStub,
                _virtualObjectEndPointDataManagerFactoryStub,
                _collectionEndPointDataManagerFactoryStub,
                _collectionEndPointCollectionProviderStub,
                _associatedCollectionStrategyFactoryStub);
        }