internal static HttpClient CreateAdminUser <T>(this WebApplicationFactory <T> factory) where T : class { var client = factory.DefaultApiClient(); var jsonCredentials = JsonSerializer.Serialize(new TestAuthHandler.Credentials { Id = NextId().ToString(), IsAdmin = true }); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(TestAuthHandler.TestScheme, jsonCredentials); return(client); }
internal static HttpClient CreateAnonymous <T>(this WebApplicationFactory <T> factory) where T : class => factory.DefaultApiClient();