public async Task Then_404_NotFound_is_not_returned()
        {
            var client = new CustomWebApplicationFactory <Startup>().CreateClient();

            var response = await client.GetAsync("/Invitations/SignUpComplete/" + Guid.NewGuid());

            response.StatusCode.Should().NotBe(HttpStatusCode.NotFound);
        }
        public async Task Then_NotFound_is_not_returned()
        {
            var client = new CustomWebApplicationFactory <Startup>().CreateClient();

            var response = await client.GetAsync("/Account/Login");

            response.StatusCode.Should().NotBe(HttpStatusCode.NotFound);
        }
Пример #3
0
        public async Task Then_404_is_not_received()
        {
            var client = new CustomWebApplicationFactory <Startup>().CreateClient(new WebApplicationFactoryClientOptions()
            {
                AllowAutoRedirect = false
            });

            var response = await client.GetAsync("/connect/authorize?client_id=apprentice&" +
                                                 "redirect_uri=https%3A%2F%2Flocalhost%3A6016%2Fsignin-oidc&" +
                                                 "response_type=id_token&" +
                                                 "scope=openid&" +
                                                 "response_mode=form_post&" +
                                                 "nonce=irrelevant&" +
                                                 "x-client-SKU=ID_NETSTANDARD1_4&" +
                                                 "x-client-ver=5.2.0.0");

            response.StatusCode.Should().NotBe(HttpStatusCode.NotFound);
        }
Пример #4
0
        public async Task Then_302_Redirect_is_received_with_correct_redirect_location()
        {
            var client = new CustomWebApplicationFactory <Startup>().CreateClient(new WebApplicationFactoryClientOptions()
            {
                AllowAutoRedirect = false
            });

            var response = await client.GetAsync("/connect/authorize?client_id=apprentice&" +
                                                 "redirect_uri=https://localhost:7070/signin-oidc&" +
                                                 "response_type=id_token&scope=openid&" +
                                                 "response_mode=form_post&" +
                                                 $"nonce={JwtNonce}&" +
                                                 "x-client-ver=5.2.0.0");

            var responseBody = await response.Content.ReadAsStringAsync();

            response.StatusCode.Should().Be(HttpStatusCode.Redirect);
            response.Headers.Location.ToString().Should()
            .Match(s => s.Contains("/Account/Login"));
        }