public ItemsController( IItemsService itemsService, IManufacturersService manufacturersService) { this.itemsService = itemsService; this.manufacturersService = manufacturersService; this.imagesNameAndContentType = new Dictionary <string, string>(); }
public ProductsController(IProductService productService, ICategoryService categoryService, IManufacturersService manufacturerService, IMemoryCache memoryCache) { this.productsService = productService; this.categoryService = categoryService; this.manufacturerService = manufacturerService; this.memoryCache = memoryCache; }
public async Task CreateManufacturer_WithNotValidInput_ShouldBeReturnFalse(string input) { this.manufacturerService = InitializeCategoriesService(); string manufacturerName = input; var isCreate = await this.manufacturerService.CreateAsync(manufacturerName); Assert.False(isCreate); }
public async Task CreateManufacturer_WithValidInput_ShouldBeReturnCorrectBool() { this.manufacturerService = InitializeCategoriesService(); string manufacturerName = @"""Изамет"" ООД"; var isCreate = await this.manufacturerService.CreateAsync(manufacturerName); Assert.True(isCreate); }
public ManufacturersController( IManufacturersService manufacturersService, ICountriesService countriesService, IUsersService usersService, IWebHostEnvironment webHostEnvironment) { this.manufacturersService = manufacturersService; this.countriesService = countriesService; this.usersService = usersService; this.webHostEnvironment = webHostEnvironment; }
public LiftsController( ILiftsService liftService, ICitiesService cityService, IManufacturersService manufacturerService, UserManager <ApplicationUser> userManager) { this.liftService = liftService; this.cityService = cityService; this.manufacturerService = manufacturerService; this.userManager = userManager; }
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; }
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); }
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); }
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; }
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); }
public ManufacturerDropdownViewComponent(IManufacturersService manufacturersService) { this.manufacturersService = manufacturersService; }
public CarsController(IManufacturersService manufacturersService, ICarsService carsService) { this.manufacturersService = manufacturersService; this.carsService = carsService; }
public ManufacturersController(IManufacturersService manufacturersService, IMemoryCache memoryCache) { this.manufacturersService = manufacturersService; this.memoryCache = memoryCache; }
public ManufacturersController(IUniStoreContext context, IManufacturersService service, User user) : base(context, user) { this.service = service; }
public ManufacturerAdministrationController(IManufacturersService manufacturers) { this.manufacturers = manufacturers; }
public ManufacturersController(IManufacturersService manufacturersService) { this.manufacturersService = manufacturersService; }
public ModelsController(IManufacturersService manufacturersService, IModelsService modelsService) { this.manufacturersService = manufacturersService; this.modelsService = modelsService; }