예제 #1
0
        public IntegracaoTestsFixture()
        {
            var clientOptions = new WebApplicationFactoryClientOptions
            {
            };

            Factory = new AppFactory <TStartup>();
            Client  = Factory.CreateClient(clientOptions);
        }
예제 #2
0
        private HttpClient GerarClient()
        {
            var clientOptions = new WebApplicationFactoryClientOptions
            {
            };

            var client = Factory.CreateClient(clientOptions);

            var token = RecuperarToken(client).Result;

            client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

            return(client);
        }