public void AuthorizationHeaderShouldNotBeSetWithoutCredentials() { using var client = new TestLokiHttpClient(); client.SetCredentials(null); client.Client.DefaultRequestHeaders.Authorization.ShouldBeNull(); }
public void ProvidedHttpClientShouldBeUsed() { using var httpClient = new HttpClient(); using var client = new TestLokiHttpClient(httpClient); client.Client.ShouldBe(httpClient); }
public void BasicAuthHeaderShouldBeCorrect() { var credentials = new LokiCredentials { Login = "******", Password = "******" }; using var client = new TestLokiHttpClient(); client.SetCredentials(credentials); var authorization = client.Client.DefaultRequestHeaders.Authorization; authorization.ShouldSatisfyAllConditions( () => authorization !.Scheme.ShouldBe("Basic"), () => authorization !.Parameter.ShouldBe("QmlsbHk6SGVycmluZ3Rvbg==")); }
public RequestsUriTests() { _client = new TestLokiHttpClient(); }
public void HttpClientShouldBeCreatedIfNotProvider() { using var client = new TestLokiHttpClient(); client.Client.ShouldNotBeNull(); }
public RequestPayloadTests() { _client = new TestLokiHttpClient(); }
public AuthTests() { _client = new TestLokiHttpClient(); }
public LokiJsonTextFormatterRequestPayloadTests() { _client = new TestLokiHttpClient(); }