private async Task IsPwnedTest(HttpClient httpClient, string password, Predicate <int> outcomePredicate) { #if !NETCOREAPP2_0 ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12 | SecurityProtocolType.Ssl3; #endif using (var client = new PwnedPasswordClient(httpClient)) { var result = await client.IsPwnedAsync(password); Assert.True(outcomePredicate(result)); } }