private static OrderModuleController GetCustomerOrderController() { var orderService = GetCustomerOrderService(); var controller = new OrderModuleController(orderService, null, null, new TimeBasedNumberGeneratorImpl(), null, null, null, null); return(controller); }
private static OrderModuleController GetCustomerOrderController() { Func <IPlatformRepository> platformRepositoryFactory = () => new PlatformRepository("VirtoCommerce", new EntityPrimaryKeyGeneratorInterceptor(), new AuditableInterceptor()); Func <ICartRepository> repositoryFactory = () => new CartRepositoryImpl("VirtoCommerce", new AuditableInterceptor()); var dynamicPropertyService = new DynamicPropertyService(platformRepositoryFactory); var orderEventPublisher = new EventPublisher <OrderChangeEvent>(Enumerable.Empty <IObserver <OrderChangeEvent> >().ToArray()); var cartEventPublisher = new EventPublisher <CartChangeEvent>(Enumerable.Empty <IObserver <CartChangeEvent> >().ToArray()); var cartService = new ShoppingCartServiceImpl(repositoryFactory, cartEventPublisher, null); var orderService = new CustomerOrderServiceImpl(GetOrderRepositoryFactory(), new TimeBasedNumberGeneratorImpl(), orderEventPublisher, cartService, null, dynamicPropertyService); var controller = new OrderModuleController(orderService, null, null, new TimeBasedNumberGeneratorImpl(), null, null); return(controller); }
private static OrderModuleController GetCustomerOrderController() { var mockInventory = new Mock <IInventoryService>(); Func <ICartRepository> repositoryFactory = () => { return(new CartRepositoryImpl("VirtoCommerce", new AuditableInterceptor())); }; var orderEventPublisher = new EventPublisher <OrderChangeEvent>(Enumerable.Empty <IObserver <OrderChangeEvent> >().ToArray()); var cartEventPublisher = new EventPublisher <CartChangeEvent>(Enumerable.Empty <IObserver <CartChangeEvent> >().ToArray()); var cartService = new ShoppingCartServiceImpl(repositoryFactory, cartEventPublisher, null); var orderService = new CustomerOrderServiceImpl(GetOrderRepositoryFactory(), new TimeBasedNumberGeneratorImpl(), orderEventPublisher, cartService, null); var controller = new OrderModuleController(orderService, null, null, new TimeBasedNumberGeneratorImpl(), null, null); return(controller); }
public void Initialize() { _controller = GetCustomerOrderController(); //var testOrder = GetTestOrder("order1"); //_controller.CreateOrder(testOrder); }