public UserDashboardModel(IOrderQuery orderQuery, IAuthHelper authHelper, IOrderApplication orderApplication, IAccountApplication accountApplication)
 {
     _orderQuery         = orderQuery;
     _authHelper         = authHelper;
     _orderApplication   = orderApplication;
     _accountApplication = accountApplication;
 }
        public void Setup()
        {
            var mock = Substitute.For <IOrderRepository>();

            var orders = new List <Order> {
                new Order {
                    Id = 1, ClientId = 1, Status = OrderStatusEnum.Pending
                }
            };

            mock.List(1)
            .Returns(orders);

            mock.Get(1)
            .Returns(orders.FirstOrDefault());

            mock.List(0)
            .Returns(new List <Order>());

            mock.UpdateStatus(new Order {
                Id = 1, Status = OrderStatusEnum.Pending
            })
            .Returns(1);

            _orderApp = new OrderApplication(mock);
        }
예제 #3
0
 public CheckoutModel(IUserQuery userQuery, ICartService cartService, IProductQuery productQuery, ICalculateCart calculateCart, IZarinPalFactory zarinPalFactory, IOrderApplication orderApplication)
 {
     _userQuery        = userQuery;
     _cartService      = cartService;
     _productQuery     = productQuery;
     _calculateCart    = calculateCart;
     _zarinPalFactory  = zarinPalFactory;
     _orderApplication = orderApplication;
 }
예제 #4
0
        public CheckoutModel(ICartCalculatorService calculatorService, ICartService cartService,
                             IProductQuery productQuery, IOrderApplication orderApplication, IZarinPalFactory zarinPalFactory, IAuthHelper authHelper)
        {
            _cartCalculatorService = calculatorService;
            _cartService           = cartService;
            _productQuery          = productQuery;
            _orderApplication      = orderApplication;
            _zarinPalFactory       = zarinPalFactory;
            _authHelper            = authHelper;

            Cart = new Cart();
        }
예제 #5
0
        private static void CreateOrder(IOrderApplication application, Guid custumerId)
        {
            var order = new OrderModel()
            {
                CustumerId = custumerId,
                Date       = DateTime.Now,
                Details    = new OrderDetailModel[]
                {
                    new()
                    {
                        ProductId = Guid.Parse("0353853f-6b34-4b2c-9c98-e51e61ec45d4"),
                        Quantity  = 10
                    },
                }
            };
            var result = application.Create(order).Result;

            Assert.IsTrue(result.IsValid);
        }
예제 #6
0
 public OrderService(ILogger <ProductService> logger, IOrderApplication orderApplication)
 {
     _logger           = logger;
     _orderApplication = orderApplication;
 }
예제 #7
0
 public IndexModel(IOrderApplication orderApplication, IAccountApplication accountApplication)
 {
     _orderApplication   = orderApplication;
     _accountApplication = accountApplication;
 }
예제 #8
0
 public OrderController(IOrderApplication appOrder, ILightPoleApplication appLightPole)
 {
     _appOrder     = appOrder;
     _appLightPole = appLightPole;
 }
예제 #9
0
 public IndexModel(IUserApplication userApplication, IOrderApplication orderApplication)
 {
     _userApplication  = userApplication;
     _orderApplication = orderApplication;
 }
예제 #10
0
 private ManagerDataSource()
 {
     OrderManager = IOC.Instance.Resolve <IOrderApplication>();
 }
 public OrderItemsModel(IOrderApplication orderApplication)
 {
     _orderApplication = orderApplication;
 }
예제 #12
0
 public OrderController(IOrderApplication orderApplication)
 {
     _orderApplication = orderApplication;
 }
예제 #13
0
 public OrderController(IOrderApplication app)
 {
     _app = app;
 }