public async Task SHOULD_not_append_default_headers_if_cleared() { //Arrange var wrapper = GetWrapper(); Sut.SetDefaultRequestHeader("userId", "123"); Sut.SetDefaultRequestHeader("name", "Bob"); MockAccessToken .With(x => x.Scheme, "Bearer") .With(x => x.Token, "bearerToken"); MockHttpClientFactory.Where_CreateClient_returns(new HttpClient(MockMessageHandler.Build().Object)); //Act MockAccessToken .With(x => x.Scheme, "") .With(x => x.Token, ""); Sut.ClearDefaultRequestHeaders(); await ExecuteAsync(wrapper, CancellationToken.None); //Assert MockMessageHandler.VerifyHeader("userId", "123", 0); MockMessageHandler.VerifyHeader("name", "Bob", 0); MockMessageHandler.VerifyNoAuthHeader(); }