コード例 #1
0
 public ItemsController(
     IItemsService itemsService,
     IManufacturersService manufacturersService)
 {
     this.itemsService             = itemsService;
     this.manufacturersService     = manufacturersService;
     this.imagesNameAndContentType = new Dictionary <string, string>();
 }
コード例 #2
0
 public ProductsController(IProductService productService,
                           ICategoryService categoryService,
                           IManufacturersService manufacturerService,
                           IMemoryCache memoryCache)
 {
     this.productsService     = productService;
     this.categoryService     = categoryService;
     this.manufacturerService = manufacturerService;
     this.memoryCache         = memoryCache;
 }
コード例 #3
0
        public async Task CreateManufacturer_WithNotValidInput_ShouldBeReturnFalse(string input)
        {
            this.manufacturerService = InitializeCategoriesService();

            string manufacturerName = input;

            var isCreate = await this.manufacturerService.CreateAsync(manufacturerName);

            Assert.False(isCreate);
        }
コード例 #4
0
        public async Task CreateManufacturer_WithValidInput_ShouldBeReturnCorrectBool()
        {
            this.manufacturerService = InitializeCategoriesService();

            string manufacturerName = @"""Изамет"" ООД";

            var isCreate = await this.manufacturerService.CreateAsync(manufacturerName);

            Assert.True(isCreate);
        }
コード例 #5
0
 public ManufacturersController(
     IManufacturersService manufacturersService,
     ICountriesService countriesService,
     IUsersService usersService,
     IWebHostEnvironment webHostEnvironment)
 {
     this.manufacturersService = manufacturersService;
     this.countriesService     = countriesService;
     this.usersService         = usersService;
     this.webHostEnvironment   = webHostEnvironment;
 }
コード例 #6
0
 public LiftsController(
     ILiftsService liftService,
     ICitiesService cityService,
     IManufacturersService manufacturerService,
     UserManager <ApplicationUser> userManager)
 {
     this.liftService         = liftService;
     this.cityService         = cityService;
     this.manufacturerService = manufacturerService;
     this.userManager         = userManager;
 }
コード例 #7
0
 public ProductsController(IProductService productsService,
                           ICategoryService categoriesService,
                           UserManager <AppUser> userManager,
                           IManufacturersService manufacturersService,
                           IViewRenderService viewRenderService)
 {
     this.productsService      = productsService;
     this.categoriesService    = categoriesService;
     this.userManager          = userManager;
     this.manufacturersService = manufacturersService;
     this.viewRenderService    = viewRenderService;
 }
コード例 #8
0
        public async Task GetAllManufacturer_WithValidInput_ShouldBeReturnCorrectAllManufacturersForViewModel()
        {
            this.manufacturerService = InitializeCategoriesService();

            string manufacturerName = @"""Изамет"" ООД";
            var    result           = await this.manufacturerService.CreateAsync(manufacturerName);

            var manufacturers = await this.manufacturerService.GetAllManufacturersForViewModel();

            Assert.Equal(1, manufacturers.Count);
            Assert.Equal(manufacturerName, manufacturers.FirstOrDefault().Name);
        }
コード例 #9
0
        public async Task GetAllManufacturers_WithValidInput_ShouldBeReturnCorrectAllCities()
        {
            this.manufacturerService = InitializeCategoriesService();

            string manufacturerNameOne = @"""Изамет"" ООД";
            string manufacturerNameTwo = @"""Лифт Груп Аспект"" ООД";

            await this.manufacturerService.CreateAsync(manufacturerNameOne);

            await this.manufacturerService.CreateAsync(manufacturerNameTwo);

            var manufacturers = await this.manufacturerService.GetAllManufacturers();

            Assert.Equal(2, manufacturers.Count);
            Assert.Equal(manufacturerNameOne, manufacturers.FirstOrDefault().Name);
            Assert.Equal(manufacturerNameTwo, manufacturers.Skip(1).Take(1).FirstOrDefault().Name);
        }
コード例 #10
0
 public ProductsController(
     IProductsService productsService,
     IBrandsService brandsService,
     ICondiitonsService condiitonsService,
     IInventoryService inventoryService,
     IManufacturersService manufacturersService,
     IWarehouseService warehouseService,
     UserManager <ApplicationUser> userManager,
     IOrderItemsService orderItemsService,
     IManualEmailSender emailSender,
     IWebHostEnvironment environment)
 {
     this.productService       = productsService;
     this.brandsService        = brandsService;
     this.condiitonsService    = condiitonsService;
     this.inventoryService     = inventoryService;
     this.manufacturersService = manufacturersService;
     this.warehouseService     = warehouseService;
     this.userManager          = userManager;
     this.orderItemsService    = orderItemsService;
     this.emailSender          = emailSender;
     this.environment          = environment;
 }
コード例 #11
0
        public void InitTestWithAdmin()
        {
            var mockDb      = new Mock <IUniStoreContext>();
            var mockService = new Mock <IManufacturersService>();

            mockService.Setup(s => s.AddManufacturer(It.IsAny <AddManufacturerBM>()));

            this.service = mockService.Object;
            // create mock principal
            var mocks = new MockRepository(MockBehavior.Default);
            Mock <IPrincipal> mockPrincipal = mocks.Create <IPrincipal>();

            mockPrincipal.SetupGet(p => p.Identity.Name).Returns("admin");
            mockPrincipal.Setup(p => p.IsInRole("Administrator")).Returns(true);

            // create mock controller context
            var mockContext = new Mock <ControllerContext>();

            mockContext.SetupGet(p => p.HttpContext.User).Returns(mockPrincipal.Object);
            mockContext.SetupGet(p => p.HttpContext.Request.IsAuthenticated).Returns(true);

            // create controller
            this.controller = new ManufacturersController(mockDb.Object, this.service);
        }
コード例 #12
0
 public ManufacturerDropdownViewComponent(IManufacturersService manufacturersService)
 {
     this.manufacturersService = manufacturersService;
 }
コード例 #13
0
 public CarsController(IManufacturersService manufacturersService, ICarsService carsService)
 {
     this.manufacturersService = manufacturersService;
     this.carsService          = carsService;
 }
コード例 #14
0
 public ManufacturersController(IManufacturersService manufacturersService, IMemoryCache memoryCache)
 {
     this.manufacturersService = manufacturersService;
     this.memoryCache          = memoryCache;
 }
コード例 #15
0
 public ManufacturersController(IUniStoreContext context, IManufacturersService service, User user)
     : base(context, user)
 {
     this.service = service;
 }
 public ManufacturerAdministrationController(IManufacturersService manufacturers)
 {
     this.manufacturers = manufacturers;
 }
コード例 #17
0
 public ManufacturersController(IManufacturersService manufacturersService)
 {
     this.manufacturersService = manufacturersService;
 }
コード例 #18
0
ファイル: ModelsController.cs プロジェクト: rl0pez/PoolIt
 public ModelsController(IManufacturersService manufacturersService, IModelsService modelsService)
 {
     this.manufacturersService = manufacturersService;
     this.modelsService        = modelsService;
 }