public async Task ReturnSuccessWithAdminRole() { SetupAdminClaimsViaHeaders(); foreach (var route in RoutesConstants.GetGrantRoutes()) { // Act var response = await Client.GetAsync($"/Grant/{route}"); // Assert response.EnsureSuccessStatusCode(); response.StatusCode.Should().Be(HttpStatusCode.OK); } }
public async Task ReturnRedirectWithoutAdminRole() { //Remove Client.DefaultRequestHeaders.Clear(); foreach (var route in RoutesConstants.GetGrantRoutes()) { // Act var response = await Client.GetAsync($"/Grant/{route}"); // Assert response.StatusCode.Should().Be(HttpStatusCode.Redirect); //The redirect to login response.Headers.Location.ToString().Should().Contain(AuthenticationConsts.AccountLoginPage); } }