Beispiel #1
0
        public UserControllerTests(IntegrationTestWebApplicationFactory <Startup> factory)
        {
            _existingUserClient = factory.WithWebHostBuilder(builder =>
            {
                builder.ConfigureTestServices(ConfigureAuthenticationHandler);
            }).CreateDefaultClient(new UnwrappingResponseHandler());

            _clientFactory = factory;
        }
        public SurveyControllerTests(IntegrationTestWebApplicationFactory <Startup> factory)
        {
            _authenticatedClient = factory.WithWebHostBuilder(builder =>
            {
                builder.ConfigureTestServices(services =>
                {
                    services.AddAuthentication("Test")
                    .AddScheme <AuthenticationSchemeOptions, TestAuthHandler>(
                        "Test", options => { });
                });
            }).CreateDefaultClient(new UnwrappingResponseHandler());

            _unauthenticatedClient = factory.CreateClient();
        }
Beispiel #3
0
 public SurveyControllerTests(IntegrationTestWebApplicationFactory <Startup> factory)
 {
     _factory = factory;
 }
Beispiel #4
0
 public AdminControllerTests(IntegrationTestWebApplicationFactory <Startup> factory)
 {
     _client = factory.CreateClient();
 }