Esempio n. 1
0
        public async Task Index_WhenHostingEnvironmentIsNotDevelopment_RedirectToSignIn()
        {
            // Arrange
            var client = new TestWebApplicationFactory().CreateClient(
                new WebApplicationFactoryClientOptions
            {
                AllowAutoRedirect = false
            }
                );

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

            // Assert
            Assert.Equal(HttpStatusCode.Redirect, response.StatusCode);
            Assert.Equal("/SignIn", response.Headers.Location.OriginalString);
        }