Пример #1
0
 public ProductCategoryMappingsController(IProductCategoryMappingsApiService productCategoryMappingsService,
                                          ICategoryService categoryService,
                                          IJsonFieldsSerializer jsonFieldsSerializer,
                                          IAclService aclService,
                                          ICustomerService customerService,
                                          IStoreMappingService storeMappingService,
                                          IStoreService storeService,
                                          IDiscountService discountService,
                                          ICustomerActivityService customerActivityService,
                                          ILocalizationService localizationService,
                                          ICategoryApiService categoryApiService,
                                          IProductApiService productApiService,
                                          IPictureService pictureService)
     : base(jsonFieldsSerializer, aclService, customerService, storeMappingService, storeService, discountService, customerActivityService, localizationService, pictureService)
 {
     _productCategoryMappingsService = productCategoryMappingsService;
     _categoryService    = categoryService;
     _categoryApiService = categoryApiService;
     _productApiService  = productApiService;
 }
Пример #2
0
        public void Setup()
        {
            var randomNumber = new Random();

            _existigMappings = new List <ProductCategory>();

            for (int i = 0; i < 1000; i++)
            {
                _existigMappings.Add(new ProductCategory()
                {
                    ProductId  = randomNumber.Next(1, 1000),
                    CategoryId = randomNumber.Next(1, 1000),
                });
            }

            var productCategoryRepo = MockRepository.GenerateStub <IRepository <ProductCategory> >();

            productCategoryRepo.Stub(x => x.TableNoTracking).Return(_existigMappings.AsQueryable());

            _productCategoryMappingsService = new ProductCategoryMappingsApiService(productCategoryRepo);
        }