public IntegrationTestsFixture() { var clientOptions = new WebApplicationFactoryClientOptions { }; Factory = new LojaAppFactory <TStartup>(); Client = Factory.CreateClient(clientOptions); }
public IntegrationTestsFixture() { var clientOptions = new WebApplicationFactoryClientOptions { AllowAutoRedirect = true, BaseAddress = new Uri("http://localhost"), HandleCookies = true, MaxAutomaticRedirections = 7 }; Factory = new LojaAppFactory <TStartup>(); Client = Factory.CreateClient(clientOptions); //já olha direto para o servidor da aplição }
public IntegrationTestsFixture() { var clientOption = new WebApplicationFactoryClientOptions { AllowAutoRedirect = true, HandleCookies = true, BaseAddress = new Uri("http://localhost"), MaxAutomaticRedirections = 7 }; Factory = new LojaAppFactory <TStartup>(); Client = Factory.CreateClient(options: clientOption); }
public async Task RealizarLoginApi() { var userData = new LoginViewModel { Email = "*****@*****.**", Senha = "Teste@123" }; Client = Factory.CreateClient(); var response = await Client.PostAsJsonAsync("api/login", userData); response.EnsureSuccessStatusCode(); UsuarioToken = await response.Content.ReadAsStringAsync(); }
public async Task RealizarLoginApi() { var userData = new LoginViewModel { Email = "*****@*****.**", Senha = "Abc!123" }; // Recriando o client para evitar configurações de Web Client = Factory.CreateClient(); var response = await Client.PostAsJsonAsync("api/login", userData); response.EnsureSuccessStatusCode(); UsuarioToken = await response.Content.ReadAsStringAsync(); }
public async Task RealizarLoginApi() { var itemInfo = new LoginViewModel { Email = "*****@*****.**", Senha = "Teste@123" }; //recriando o client para evitar configuracoes de web Client = Factory.CreateClient(); var postResponse = await Client.PostAsJsonAsync("api/login", itemInfo); postResponse.EnsureSuccessStatusCode(); UsuarioToken = await postResponse.Content.ReadAsStringAsync(); }