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 CustomerOrderServiceImpl GetCustomerOrderService() { Func<IPlatformRepository> platformRepositoryFactory = () => new PlatformRepository("VirtoCommerce", new EntityPrimaryKeyGeneratorInterceptor(), new AuditableInterceptor()); Func<IOrderRepository> orderRepositoryFactory = () => { return new OrderRepositoryImpl("VirtoCommerce", new AuditableInterceptor(), new EntityPrimaryKeyGeneratorInterceptor()); }; Func<ICartRepository> repositoryFactory = () => { return 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, dynamicPropertyService); var settingManager = new SettingsManager(null, null, null, null); var orderService = new CustomerOrderServiceImpl(orderRepositoryFactory, new TimeBasedNumberGeneratorImpl(), orderEventPublisher, cartService, GetItemService(), dynamicPropertyService, settingManager, null, null); return orderService; }
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; }