public EmployeesControllerIntegrationTests(TestWebApplicationFactory <Startup> factory)
        {
            _httpClientHelper = new HttpClientHelper(factory.CreateDefaultClient());
            var repository = new EmployeeRepository(factory.Context, new LoggerFactory());

            _controller = new EmployeesController(repository);
        }
Example #2
0
        public void Setup()
        {
            var factory = new TestWebApplicationFactory <FirewallStartup>(async context =>
            {
                await context.Response.SetBodyFromStringAsync("Hello world!");
            });

            client = factory.CreateDefaultClient();

            var simpleFactory = new TestWebApplicationFactory <SimpleStartup>(async context =>
            {
                await context.Response.SetBodyFromStringAsync("Hello world!");
            });

            simpleClient = simpleFactory.CreateDefaultClient();
        }