コード例 #1
0
        public IntegrationTestsFixture()
        {
            var clientOptions = new WebApplicationFactoryClientOptions {
            };

            Factory = new LojaAppFactory <TStartup>();
            Client  = Factory.CreateClient(clientOptions);
        }
コード例 #2
0
        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
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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();
        }
コード例 #5
0
        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();
        }
コード例 #6
0
        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();
        }