Esempio n. 1
0
 public UserProfileServices(PCHUBDbContext context,
                            UserManager <User> userManager, IProductServices productService)
 {
     this.context        = context;
     this.userManager    = userManager;
     this.productService = productService;
 }
Esempio n. 2
0
 public LoginModel(SignInManager <User> signInManager,
                   ILogger <LoginModel> logger,
                   UserManager <User> userManager,
                   PCHUBDbContext context)
 {
     _userManager   = userManager;
     this.context   = context;
     _signInManager = signInManager;
     _logger        = logger;
 }
Esempio n. 3
0
 public ApplyCharacteristicsController(PCHUBDbContext context)
 {
     this.context = context;
 }
 public AdminCharacteristicsServices(PCHUBDbContext context)
 {
     this.context = context;
 }
Esempio n. 5
0
 public HomeService(PCHUBDbContext context)
 {
     this.context = context;
 }
 public SupportChartsService(PCHUBDbContext context)
 {
     this.context = context;
 }
Esempio n. 7
0
 public RequestChatServices(PCHUBDbContext context)
 {
     this.context = context;
 }
Esempio n. 8
0
 public AdminFiltersServices(PCHUBDbContext context)
 {
     this.context = context;
 }
Esempio n. 9
0
        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())));
        }
Esempio n. 10
0
 public ShopServices(PCHUBDbContext context, IProductServices productService)
 {
     this.context        = context;
     this.productService = productService;
 }
Esempio n. 11
0
 public ForumServices(PCHUBDbContext context)
 {
     this.context = context;
 }
Esempio n. 12
0
 public ProductServices(PCHUBDbContext context)
 {
     this.context = context;
 }
Esempio n. 13
0
 public ShipmentManagerServices(PCHUBDbContext context)
 {
     this.context = context;
 }
 public AdminCategoryPagesServices(PCHUBDbContext context)
 {
     this.context = context;
 }
Esempio n. 15
0
 public CategoryServices(PCHUBDbContext context)
 {
     this.context = context;
 }
 public AdminIndexPageServices(PCHUBDbContext context)
 {
     this.context = context;
 }
Esempio n. 17
0
 public AdminLayoutServices(PCHUBDbContext context)
 {
     this.context = context;
 }