Ejemplo n.º 1
0
        //[TestMethod]
        //public void SearchCarts()
        //{
        //	var controller = GetCartController();
        //	var result = controller.SearchCarts(new webModel.SearchCriteria { SiteId = "test" }) as OkNegotiatedContentResult<webModel.SearchResult>;
        //	Assert.IsNotNull(result.Content);
        //}

        private static CartModuleController GetCartController()
        {
            Func <ICartRepository> repositoryFactory = () =>
            {
                return(new CartRepositoryImpl("VirtoCommerce", new AuditableInterceptor(null), new EntityPrimaryKeyGeneratorInterceptor()));
            };
            //Business logic for core model


            var cartService   = new ShoppingCartServiceImpl(repositoryFactory, new Mock <IEventPublisher <CartChangeEvent> >().Object, new Mock <IItemService>().Object, new Mock <IDynamicPropertyService>().Object);
            var searchService = new ShoppingCartSearchServiceImpl(repositoryFactory);
            //var memoryPaymentGatewayManager = new InMemoryPaymentGatewayManagerImpl();


            var controller = new CartModuleController(cartService, searchService, new Mock <IStoreService>().Object);

            return(controller);
        }
Ejemplo n.º 2
0
        //[TestMethod]
        //public void SearchCarts()
        //{
        //	var controller = GetCartController();
        //	var result = controller.SearchCarts(new webModel.SearchCriteria { SiteId = "test" }) as OkNegotiatedContentResult<webModel.SearchResult>;
        //	Assert.IsNotNull(result.Content);
        //}

        private static CartModuleController GetCartController()
        {
            Func <ICartRepository> repositoryFactory = () =>
            {
                return(new CartRepositoryImpl("VirtoCommerce", new AuditableInterceptor(),
                                              new EntityPrimaryKeyGeneratorInterceptor()));
            };
            //Business logic for core model


            var cartService   = new ShoppingCartServiceImpl(repositoryFactory, null, null);
            var searchService = new ShoppingCartSearchServiceImpl(repositoryFactory);
            //var memoryPaymentGatewayManager = new InMemoryPaymentGatewayManagerImpl();


            var controller = new CartModuleController(cartService, searchService, null);

            return(controller);
        }