コード例 #1
0
        public void SetUp()
        {
            DomainEvent.TurnOff();

            MockRepository.GenerateStub<IRepository<Size>>();
            sizeService = new SizeService();
        }
コード例 #2
0
ファイル: SizeServiceTests.cs プロジェクト: wshcdr/sutekishop
        public void SetUp()
        {
            DomainEvent.TurnOff();

            MockRepository.GenerateStub <IRepository <Size> >();
            sizeService = new SizeService();
        }
コード例 #3
0
 public SizeFacade(ISizeService sizeService, ISizeTranslationService sizeTranslationService, IRestaurantService restaurantService, IItemSizeService itemSizeService, IUnitOfWorkAsync unitOfWork) : base(unitOfWork)
 {
     _sizeTranslationService = sizeTranslationService;
     _sizeService            = sizeService;
     _restaurantService      = restaurantService;
     _itemSizeService        = itemSizeService;
 }
コード例 #4
0
 public ProductController()
 {
     _productService        = new ProductService(new ProductRepository(new oecsEntities()));
     _productDetailService  = new ProductDetailService(new ProductDetailRepository(new oecsEntities()));
     _productGalleryService = new ProductGalleryService(new ProductGalleryRepository(new oecsEntities()));
     _sizeService           = new SizeService(new SizeRepository(new oecsEntities()));
 }
コード例 #5
0
		public void Setup()
		{
			products= new List<Product>();
			images = new List<Image>();
			validator = MockRepository.GenerateStub<IValidatingBinder>();
			repository = MockRepository.GenerateStub<IRepository<Product>>();
			repository.Expect(x => x.GetAll()).Return(products.AsQueryable());
			fileService = MockRepository.GenerateStub<IHttpFileService>();
			imageOrderableService = MockRepository.GenerateStub<IOrderableService<ProductImage>>();
			fileService.Expect(x => x.GetUploadedImages(null)).IgnoreArguments().Return(images);
			sizeService = MockRepository.GenerateStub<ISizeService>();
			
			var resolver = MockRepository.GenerateStub<IRepositoryResolver>();
			
			controllerContext = new ControllerContext()
			{
				HttpContext = MockRepository.GenerateStub<HttpContextBase>()
			};

			controllerContext.HttpContext.Stub(x => x.Request).Return(MockRepository.GenerateStub<HttpRequestBase>());
			sizeService.Expect(x => x.WithValues(controllerContext.HttpContext.Request.Form)).Return(sizeService);

			valueProvider = new FakeValueProvider();
			bindingContext = new ModelBindingContext() 
			{
				ModelState = new ModelStateDictionary(),
                ModelMetadata = ModelMetadataProviders.Current.GetMetadataForType(null, typeof(Product)),
				ModelName = "product",
				ValueProvider = valueProvider
			};

			binder = new ProductBinder(validator, resolver, repository, fileService, imageOrderableService, sizeService);
		}
コード例 #6
0
 public ProductController(IProductService productService, ISizeService sizeService, ITypeService typeService, IOriginService originService, IModelService modelService)
 {
     _productService = productService;
     _sizeService = sizeService;
     _typeService = typeService;
     _originService = originService;
     _modelService = modelService;
 }
コード例 #7
0
		public ProductBinder(IValidatingBinder validatingBinder, IRepositoryResolver resolver, IRepository<Product> repository, IHttpFileService httpFileService, IOrderableService<ProductImage> orderableService, ISizeService sizeService)
			: base(validatingBinder, resolver)
		{
			this.repository = repository;
			this.httpFileService = httpFileService;
			this.orderableService = orderableService;
			this.sizeService = sizeService;
		}
コード例 #8
0
        public ProductDetailService(IProductDetailRepository productDetailRepository)
        {
            _productDetailRepository  = productDetailRepository;
            _productGalleryRepository = new ProductGalleryRepository(new oecsEntities());

            _colorService = new ColorService(new ColorRepository(new oecsEntities()));
            _sizeService  = new SizeService(new SizeRepository(new oecsEntities()));
        }
コード例 #9
0
 public ProductController(IProductService productService, ICategoryService categoryService, ISizeService sizeService, IColorService colorService, ISupplierService supplierService)
 {
     _productService  = productService;
     _categoryService = categoryService;
     _sizeService     = sizeService;
     _colorService    = colorService;
     _supplierService = supplierService;
 }
コード例 #10
0
ファイル: HomeController.cs プロジェクト: Citr0s/ShoppingCart
 public HomeController(IPizzaSizeService pizzaSizeService, IToppingService toppingService,
                       ISizeService sizeService, IUserSessionService userSessionService)
 {
     _pizzaSizeService   = pizzaSizeService;
     _toppingService     = toppingService;
     _sizeService        = sizeService;
     _userSessionService = userSessionService;
 }
コード例 #11
0
 public searchApi(IServiceFactory servicefactory, ILogger <searchApi> logger)
 {
     // Factory pattern Get the instances from the factory for the E-commerce Shoes filtering options.
     _brandService    = servicefactory.GetServiceInstance <IBrandService>();
     _categoryService = servicefactory.GetServiceInstance <ICategoryService>();
     _sizeService     = servicefactory.GetServiceInstance <ISizeService>();
     _colorService    = servicefactory.GetServiceInstance <IColorService>();
     _personService   = servicefactory.GetServiceInstance <IPersonService>();
 }
コード例 #12
0
 public SizesAdminPresenter(ISizesAdminView view, ISizeService sizeService)
     : base(view)
 {
     this.sizeService          = sizeService;
     this.View.OnSizesGetData += this.View_OnSizesGetData;
     this.View.OnSizeDelite   += this.View_OnSizesDelete;
     this.View.OnSizeEdit     += this.View_OnSizesEdit;
     this.View.OnSizeCreate   += this.View_OnSizesCreate;
 }
コード例 #13
0
		public ProductController(IRepository<Product> productRepository, IRepository<Category> categoryRepository, ISizeService sizeService, IOrderableService<Product> productOrderableService, IUserService userService, IUnitOfWorkManager uow)
		{
			this.productRepository = productRepository;
			this.uow = uow;
			this.userService = userService;
			this.categoryRepository = categoryRepository;
			this.sizeService = sizeService;
			this.productOrderableService = productOrderableService;
		}
コード例 #14
0
        public ProductService(IProductRepository productRepository)
        {
            _productRepository = productRepository;

            _colorService    = new ColorService(new ColorRepository(new oecsEntities()));
            _sizeService     = new SizeService(new SizeRepository(new oecsEntities()));
            _brandService    = new BrandService(new BrandRepository(new oecsEntities()));
            _categoryService = new CategoryService(new CategoryRepository(new oecsEntities()));
        }
コード例 #15
0
 public FirmaController(IProductService productService, ISupplierService supplierService, IColorService colorService, ISizeService sizeService, ICategoryService categoryService, IOrderDetailService orderDetailService)
 {
     _productService     = productService;
     _supplierService    = supplierService;
     _categoryService    = categoryService;
     _colorService       = colorService;
     _sizeService        = sizeService;
     _orderDetailService = orderDetailService;
 }
コード例 #16
0
        public RedistFileService(IApplicationSettings applicationSettings, IDirectoryService directoryService, ISizeService sizeService)
        {
            _directoryService = directoryService;
            _sizeService      = sizeService;

            const RegexOptions regexOptions = RegexOptions.IgnoreCase | RegexOptions.Compiled;

            _redistFolders = applicationSettings.RedistFolders.ToDictionary(x => new Regex(x.Key, regexOptions), y => y.Value);
            _redistFiles   = applicationSettings.RedistFiles.ToDictionary(x => new Regex(x.Key, regexOptions), y => y.Value);
        }
コード例 #17
0
 public ProductController(IProductService productService, ICategoryService categoryService, ISuppelierService suppelierService, IProductDetailService productDetailService, IColorService colorService, ISizeService sizeService, IDiscountCodeService discountCodeService)
 {
     this.productService       = productService;
     this.categoryService      = categoryService;
     this.suppelierService     = suppelierService;
     this.productDetailService = productDetailService;
     this.colorService         = colorService;
     this.sizeService          = sizeService;
     this.discountCodeService  = discountCodeService;
 }
コード例 #18
0
 public ProductController(IProductService productService, IConfiguration configuration,
                          IBillService billService,
                          IProductCategoryService productCategoryService, ISizeService sizeService, IColorService colorService)
 {
     _productService         = productService;
     _productCategoryService = productCategoryService;
     _sizeService            = sizeService;
     _colorService           = colorService;
     _configuration          = configuration;
     _billService            = billService;
 }
コード例 #19
0
 public ProductController(IProductService productService,
                          IProductCategoryService productCategoryService,
                          IColorService colorService,
                          ISizeService sizeService,
                          IPriceService priceService)
 {
     this._productService         = productService;
     this._productCategoryService = productCategoryService;
     this._colorService           = colorService;
     this._sizeService            = sizeService;
     this._priceService           = priceService;
 }
コード例 #20
0
        public Seeder(IServiceFactory servicefactory, DataContext context)
        {
            _brandService    = servicefactory.GetServiceInstance <IBrandService>();
            _categoryService = servicefactory.GetServiceInstance <ICategoryService>();
            _sizeService     = servicefactory.GetServiceInstance <ISizeService>();
            _colorService    = servicefactory.GetServiceInstance <IColorService>();
            _personService   = servicefactory.GetServiceInstance <IPersonService>();

            _productService        = servicefactory.GetServiceInstance <IProductService>();
            _productVariantService = servicefactory.GetServiceInstance <IProductVariantService>();
            _context = context;
        }
コード例 #21
0
ファイル: CartController.cs プロジェクト: war-man/KLTN
        //private string merchantId = ConfigHelper.GetByKey("MerchantId");
        //private string merchantPassword = ConfigHelper.GetByKey("MerchantPassword");
        //private string merchantEmail = ConfigHelper.GetByKey("MerchantEmail");


        public CartController(IProductService productService, IBillService billService, IViewRenderService viewRenderService, IEmailSender emailSender, IConfiguration configuration, IColorService color, ISizeService size, IHubContext <OnlineShopHub> hubContext, IProductQuantityService quantityService)
        {
            _productService    = productService;
            _billService       = billService;
            _viewRenderService = viewRenderService;
            _emailSender       = emailSender;
            _configuration     = configuration;
            _color             = color;
            _size            = size;
            _hubContext      = hubContext;
            _quantityService = quantityService;
        }
コード例 #22
0
 public ProductsController(
     IProductService productService,
     IColorService colorService,
     ISizeService sizeService,
     AppDbContext context,
     IMapper mapper)
 {
     _productService = productService;
     _colorService   = colorService;
     _sizeService    = sizeService;
     _context        = context;
     _mapper         = mapper;
 }
コード例 #23
0
        public ProductDetailViewModel(IRegionChangeManager regionChangeManager, IEventAggregator eventAggregator, IProductDetailService productDetailService, ISizeService sizeService)
        {
            _regionChangeManager  = regionChangeManager;
            _eventAggregator      = eventAggregator;
            _productDetailService = productDetailService;
            _sizeService          = sizeService;

            AddProductToCartCommand = new DelegateCommand(OnAddProductToCartCommandExecute);
            BackToOverViewCommand   = new DelegateCommand(OnBackToOverviewCommandExecute);
            InitializeCommand       = new DelegateCommand(OnInitializeCommandExecute, OnInitializeCommandCanExecute);

            Sizes = new List <SizeModel>();
        }
コード例 #24
0
 public CartController(IProductService productService, IBillService billService,
                       IColorService colorService, ISizeService sizeService, IUserService userService,
                       ITagService tagService, IHostingEnvironment hostingEnvironment, IEmailSender emailSender)
 {
     this._productService     = productService;
     this._billService        = billService;
     this._colorService       = colorService;
     this._sizeService        = sizeService;
     this._userService        = userService;
     this._tagService         = tagService;
     this._hostingEnvironment = hostingEnvironment;
     this._emailSender        = emailSender;
 }
コード例 #25
0
 public ProductController(IProductService productService, IProductCategoryService productCategoryService,
                          IConfiguration configuration, ISizeService sizeService, IColorService colorService,
                          ITagService tagService, IBlogService blogService, IAdvertisementService advertisementService, UserManager <AppUser> userManager)
 {
     this._productCategoryService = productCategoryService;
     this._advertisementService   = advertisementService;
     this._productService         = productService;
     this._configuration          = configuration;
     this._colorService           = colorService;
     this._sizeService            = sizeService;
     this._tagService             = tagService;
     this._blogService            = blogService;
     this._userManager            = userManager;
 }
コード例 #26
0
 public HomeController(IProductService productService, IBlogService blogService,
                       IProductCategoryService productCategoryService, ISlideService slideService,
                       IFeedbackService feedbackService, ISizeService sizeService, IMemoryCache cache,
                       IAdvertisementService advertisementService)
 {
     this._productService         = productService;
     this._blogService            = blogService;
     this._productCategoryService = productCategoryService;
     this._advertisementService   = advertisementService;
     this._slideService           = slideService;
     this._feedbackService        = feedbackService;
     this._sizeService            = sizeService;
     this._cache = cache;
 }
コード例 #27
0
        public SizeController(ISizeService SizeService, IUnitOfWork unitOfWork, IExceptionHandlingService exec)
        {
            _SizeService = SizeService;
            _unitOfWork  = unitOfWork;
            _exception   = exec;

            UserRoles = (List <string>)System.Web.HttpContext.Current.Session["Roles"];

            //Log Initialization
            LogVm.SessionId      = 0;
            LogVm.ControllerName = System.Web.HttpContext.Current.Request.RequestContext.RouteData.GetRequiredString("controller");
            LogVm.ActionName     = System.Web.HttpContext.Current.Request.RequestContext.RouteData.GetRequiredString("action");
            LogVm.User           = System.Web.HttpContext.Current.Request.RequestContext.HttpContext.User.Identity.Name;
        }
コード例 #28
0
 public ProductController(IProductService productService,
                          IProductCategoryService productCategoryService,
                          IColorService colorService,
                          ISizeService sizeService,
                          IHostingEnvironment hostingEnvironment,
                          IViewRenderService viewRenderService)
 {
     _productService         = productService;
     _productCategoryService = productCategoryService;
     _colorService           = colorService;
     _sizeService            = sizeService;
     _hostingEnvironment     = hostingEnvironment;
     _viewRenderService      = viewRenderService;
 }
コード例 #29
0
 public ShoppingCartController(IOrderService orderService,
                               IProductService productService,
                               ApplicationUserManager userManager,
                               IColorService colorService,
                               ISizeService sizeService,
                               IPriceService priceService)
 {
     this._productService = productService;
     this._userManager    = userManager;
     this._orderService   = orderService;
     this._priceService   = priceService;
     this._colorService   = colorService;
     this._sizeService    = sizeService;
 }
コード例 #30
0
        private MainViewModel(ISteamFolderService steamFolderService, ISizeService sizeService)
        {
            _steamFolderService = steamFolderService;
            _sizeService        = sizeService;

            FindSteamFolder = new DelegateCommand(FindSteamFolderExecute, CanFindSteamFolder);
            AddFolder       = new DelegateCommand(AddFolderExecute, CanAddFolder);
            RemoveFolder    = new DelegateCommand(RemoveFolderExecute, CanRemoveFolder);
            Search          = new DelegateCommand(SearchExecute, CanSearch);
            DeletePackages  = new DelegateCommand(DeletePackagesExecute, CanDeletePackages);

            CanUseControls  = true;
            FoldersToSearch = new ObservableCollection <string>();
            FoldersToDelete = new ObservableCollection <RedistItem>();
        }
コード例 #31
0
 public BillController(
     IBillService billService,
     IHostingEnvironment hostingEnvironment,
     IViewRenderService viewRenderService,
     IProductService productService,
     IColorService colorService,
     ISizeService sizeService
     )
 {
     _billService        = billService;
     _hostingEnvironment = hostingEnvironment;
     _viewRenderService  = viewRenderService;
     _productService     = productService;
     _colorService       = colorService;
     _sizeService        = sizeService;
 }
コード例 #32
0
ファイル: CartController.cs プロジェクト: minhvh107/CMSCore
 public CartController(
     IProductService productService,
     IColorService colorService,
     ISizeService sizeService,
     IBillService billService,
     IViewRenderService viewRenderService,
     IConfiguration configuration,
     IEmailSender emailSender)
 {
     _productService    = productService;
     _colorService      = colorService;
     _sizeService       = sizeService;
     _viewRenderService = viewRenderService;
     _configuration     = configuration;
     _emailSender       = emailSender;
     _billService       = billService;
 }
コード例 #33
0
 public ProductsController
 (
     IProductService productService,
     ITypeService typeService,
     ISubtypeService subtypeService,
     ISizeService sizeService,
     ITradeMarkService tradeMarkService,
     IMapper automapper
 )
 {
     _productService   = productService;
     _typeService      = typeService;
     _subtypeService   = subtypeService;
     _sizeService      = sizeService;
     _tradeMarkService = tradeMarkService;
     _automapper       = automapper;
 }
コード例 #34
0
        public ShoppingCartController(
            IProductService productService,
            IOrderService orderService,
            IOrderDetailsService orderDetailsService,
            IContactInfoService contactInfoService,
            IUserService userService,
            ISizeService sizeService)
        {
            Guard.WhenArgument(productService, "productService").IsNull().Throw();
            Guard.WhenArgument(orderService, "orderService").IsNull().Throw();
            Guard.WhenArgument(orderDetailsService, "orderDetailsService").IsNull().Throw();
            Guard.WhenArgument(contactInfoService, "contactInfoService").IsNull().Throw();
            Guard.WhenArgument(userService, nameof(userService)).IsNull().Throw();
            Guard.WhenArgument(sizeService, nameof(sizeService)).IsNull().Throw();

            this.productService      = productService;
            this.orderService        = orderService;
            this.orderDetailsService = orderDetailsService;
            this.contactInfoService  = contactInfoService;
            this.userService         = userService;
            this.sizeService         = sizeService;
        }
コード例 #35
0
        public void SetUp()
        {
            // you have to be an administrator to access the product controller
            Thread.CurrentPrincipal = new GenericPrincipal(new GenericIdentity("admin"), new[] { "Administrator" });

            categoryRepository = MockRepositoryBuilder.CreateCategoryRepository();

            productRepository = MockRepositoryBuilder.CreateProductRepository();

            MockRepository.GenerateStub<IRepository<ProductImage>>();

            MockRepository.GenerateStub<IHttpFileService>();
            sizeService = MockRepository.GenerateStub<ISizeService>();

            productOrderableService = MockRepository.GenerateStub<IOrderableService<Product>>();
            MockRepository.GenerateStub<IOrderableService<ProductImage>>();

        	userService = MockRepository.GenerateStub<IUserService>();

			productController = new ProductController(productRepository, categoryRepository, sizeService, productOrderableService, userService, MockRepository.GenerateStub<IUnitOfWorkManager>());

        	userService.Expect(c => c.CurrentUser).Return(new User { RoleId = Role.AdministratorId });
        }
コード例 #36
0
 public ProductController(IErrorService errorService, IProductService productService,
                          IProductMaterialService productMaterialService, IMaterialService materialService,
                          IProductColorService productColorService, IColorService colorService,
                          IProductSizeService productSizeService, ISizeService sizeService,
                          IProductHeightService productHeightService, IHeightService heightService,
                          IProductTypeService productTypeService, ITypeService typeService,
                          IProductHeelService productHeelService, IHeelService heelService)
     : base(errorService)
 {
     this._productHeelService     = productHeelService;
     this._heelService            = heelService;
     this._productTypeService     = productTypeService;
     this._typeService            = typeService;
     this._productHeightService   = productHeightService;
     this._heightService          = heightService;
     this._productSizeService     = productSizeService;
     this._sizeService            = sizeService;
     this._productService         = productService;
     this._materialService        = materialService;
     this._productColorService    = productColorService;
     this._colorService           = colorService;
     this._productMaterialService = productMaterialService;
 }
コード例 #37
0
 public SizeController(ISizeService sizeService)
 {
     _sizeService = sizeService;
 }