public UserProfileServices(PCHUBDbContext context, UserManager <User> userManager, IProductServices productService) { this.context = context; this.userManager = userManager; this.productService = productService; }
public LoginModel(SignInManager <User> signInManager, ILogger <LoginModel> logger, UserManager <User> userManager, PCHUBDbContext context) { _userManager = userManager; this.context = context; _signInManager = signInManager; _logger = logger; }
public ApplyCharacteristicsController(PCHUBDbContext context) { this.context = context; }
public AdminCharacteristicsServices(PCHUBDbContext context) { this.context = context; }
public HomeService(PCHUBDbContext context) { this.context = context; }
public SupportChartsService(PCHUBDbContext context) { this.context = context; }
public RequestChatServices(PCHUBDbContext context) { this.context = context; }
public AdminFiltersServices(PCHUBDbContext context) { this.context = context; }
public void WithStatusCodeShouldNotThrowExceptionWithCorrectStatusCode() { MyApplication .StartsFrom <TestStartup>() .WithServices(services => { services.AddActionContextAccessor(); }); var context = new PCHUBDbContext(); var mock = new Mock <ILogger <HomeController> >(); ILogger <HomeController> logger = mock.Object; var model = new IndexViewModel(); //or use this short equivalent logger = Mock.Of <ILogger <HomeController> >(); var service = new HomeService(context); var mapperConfiguration = new MapperConfiguration(config => { config.AddProfile <AdminProfile>(); config.AddProfile <ProductsProfile>(); config.AddProfile <UsersProfile>(); config.AddProfile <ApiProfile>(); }); var mapper = new Mapper(mapperConfiguration); MyController <HomeController> .Instance( instance => instance .WithDependencies( logger, service, mapper )) .Calling(c => c.Index()) .ShouldReturn() .View(view => view.WithModelOfType <IndexViewModel>().Passing(model => model.Boxes.Any())); MyRouting .Configuration() .ShouldMap(request => request .WithLocation("/Home/Index") .WithMethod(HttpMethod.Get)) .To <HomeController>(c => c.Index()); MyController <HomeController> .Instance(instance => instance .WithDependencies( logger, service, mapper ) .WithUser(user => user .WithUsername("obelix"))) .Calling(c => c.Index()) .ShouldReturn() .View(view => view.WithModelOfType <IndexViewModel>().Passing(model => model.Categories.Any())); MyRouting .Configuration() .ShouldMap(request => request .WithLocation("/Home/Error") .WithMethod(HttpMethod.Get)) .To <HomeController>(c => c.Error()); MyRouting .Configuration() .ShouldMap(request => request .WithLocation("/Home/Privacy") .WithMethod(HttpMethod.Get)) .To <HomeController>(c => c.Privacy()); // Task<ActionResult<List<ApiProductHistoryViewModel>>> ReviewedProducts() MyController <HomeController> .Instance(instance => instance .WithDependencies( logger, service, mapper ) .WithUser(user => user .WithUsername("obelix"))) .Calling(c => c.ReviewedProducts()) .ShouldReturn() .ActionResult(result => result.Object(obj => obj.WithModelOfType <List <ApiProductHistoryViewModel> >().Passing(x => x.Any()))); }
public ShopServices(PCHUBDbContext context, IProductServices productService) { this.context = context; this.productService = productService; }
public ForumServices(PCHUBDbContext context) { this.context = context; }
public ProductServices(PCHUBDbContext context) { this.context = context; }
public ShipmentManagerServices(PCHUBDbContext context) { this.context = context; }
public AdminCategoryPagesServices(PCHUBDbContext context) { this.context = context; }
public CategoryServices(PCHUBDbContext context) { this.context = context; }
public AdminIndexPageServices(PCHUBDbContext context) { this.context = context; }
public AdminLayoutServices(PCHUBDbContext context) { this.context = context; }