Beispiel #1
0
        public void OrdersTestsInitialize()
        {
            Resolve <IDbConnectionFactory>().DeleteAllTestData();

            _orderPricesCommand = CreateOrderPricesCommand();
            _purchasesCommand   = CreatePurchasesCommand();
            _ordersCommand      = CreateOrdersCommand(_purchasesCommand);
        }
Beispiel #2
0
 public OrdersCommand(IOrdersRepository repository, IOrderPricesCommand orderPricesCommand, IProductsQuery productsQuery, IAllocationsCommand allocationsCommand, IAllocationsQuery allocationsQuery, IPurchasesCommand purchasesCommand)
 {
     _repository         = repository;
     _orderPricesCommand = orderPricesCommand;
     _productsQuery      = productsQuery;
     _allocationsCommand = allocationsCommand;
     _allocationsQuery   = allocationsQuery;
     _purchasesCommand   = purchasesCommand;
 }
Beispiel #3
0
 private IOrdersCommand CreateOrdersCommand(IPurchasesCommand purchasesCommand)
 {
     return(new OrdersCommand(
                new OrdersRepository(Resolve <IDataContextFactory>(), new MockAdjustmentPersister()),
                new OrderPricesCommand(Resolve <ICreditCardsQuery>(), new MockAdjustmentPersister()),
                _productsQuery,
                Resolve <IAllocationsCommand>(),
                _allocationsQuery,
                purchasesCommand));
 }
Beispiel #4
0
        protected Order CreateOrder(IPurchasesCommand puchasesCommand)
        {
            var product = _productsQuery.GetProduct("Contacts5");

            IOrdersCommand ordersCommand = new OrdersCommand(
                Resolve <IOrdersRepository>(),
                Resolve <IOrderPricesCommand>(),
                _productsQuery,
                Resolve <IAllocationsCommand>(),
                Resolve <IAllocationsQuery>(),
                puchasesCommand);

            return(ordersCommand.PrepareOrder(new[] { product.Id }, null, null, CreateCreditCard(AustralianCreditCardNumber).CardType));
        }
Beispiel #5
0
 public OrdersReportsTests()
 {
     _purchasesCommand = CreatePurchasesCommand();
     _ordersCommand    = CreateOrdersCommand(_purchasesCommand);
 }