public UserJwtControllerIntTest() { _factory = new AppWebApplicationFactory <TestStartup>(); _client = _factory.CreateClient(); _userManager = _factory.GetRequiredService <UserManager <User> >(); _passwordHasher = _factory.GetRequiredService <IPasswordHasher <User> >(); }
public static User ReloadUser <TEntryPoint>(AppWebApplicationFactory <TEntryPoint> factory, User user) where TEntryPoint : class { var applicationDatabaseContext = factory.GetRequiredService <ApplicationDatabaseContext>(); applicationDatabaseContext.Entry(user).Reload(); return(user); }
public EmployeesControllerIntTest() { _factory = new AppWebApplicationFactory <TestStartup>().WithMockUser(); _client = _factory.CreateClient(); _employeeRepository = _factory.GetRequiredService <IEmployeeRepository>(); InitTest(); }
public ProdutoResourceIntTest() { _factory = new AppWebApplicationFactory <TestStartup>().WithMockUser(); _client = _factory.CreateClient(); _produtoRepository = _factory.GetRequiredService <IProdutoRepository>(); InitTest(); }
public DepartmentResourceIntTest() { _factory = new AppWebApplicationFactory <TestStartup>().WithMockUser(); _client = _factory.CreateClient(); _departmentRepository = _factory.GetRequiredService <IDepartmentRepository>(); var config = new MapperConfiguration(cfg => { cfg.AddProfile(new AutoMapperProfile()); }); _mapper = config.CreateMapper(); InitTest(); }
public UserResourceIntTest() { _factory = new AppWebApplicationFactory <TestStartup>().WithMockUser("test", new HashSet <string> { RolesConstants.ADMIN }); _client = _factory.CreateClient(); _userManager = _factory.GetRequiredService <UserManager <User> >(); _passwordHasher = _userManager.PasswordHasher; var config = new MapperConfiguration(cfg => { cfg.AddProfile(new AutoMapperProfile()); }); _mapper = config.CreateMapper(); InitTest(); }
public AccountResourceIntTest() { _factory = new AppWebApplicationFactory <TestStartup>(); }
public ProfileInfoControllerIntTest() { _factory = new AppWebApplicationFactory <TestStartup>(); }