예제 #1
0
        public override void SetUp()
        {
            base.SetUp();

            _parentTransactionContextMock         = MockRepository.GenerateStrictMock <IParentTransactionContext> ();
            _unlockedParentTransactionContextMock = MockRepository.GenerateStrictMock <IUnlockedParentTransactionContext> ();
            _persistenceStrategy = new SubPersistenceStrategy(_parentTransactionContextMock);

            _queryStub = MockRepository.GenerateStub <IQuery>();

            _orderNumberPropertyDefinition = GetPropertyDefinition(typeof(Order), "OrderNumber");
            _fileNamePropertyDefinition    = GetPropertyDefinition(typeof(OrderTicket), "FileName");
            _productPropertyDefinition     = GetPropertyDefinition(typeof(OrderItem), "Product");

            _virtualObjectRelationEndPointID = RelationEndPointID.Create(DomainObjectIDs.Order1, GetEndPointDefinition(typeof(Order), "OrderTicket"));
            _collectionEndPointID            = RelationEndPointID.Create(DomainObjectIDs.Order1, GetEndPointDefinition(typeof(Order), "OrderItems"));
            _nonVirtualEndPointID            = RelationEndPointID.Create(DomainObjectIDs.Order1, GetEndPointDefinition(typeof(Order), "Customer"));

            _alreadyLoadedObjectDataProviderMock = MockRepository.GenerateStrictMock <ILoadedObjectDataProvider>();
        }
예제 #2
0
 public SubPersistenceStrategy(IParentTransactionContext parentTransactionContext)
 {
     ArgumentUtility.CheckNotNull("parentTransactionContext", parentTransactionContext);
     _parentTransactionContext = parentTransactionContext;
 }