Skip to content

Commit

Permalink
added new testes
Browse files Browse the repository at this point in the history
  • Loading branch information
Adolfok3 committed Apr 24, 2024
1 parent a08371f commit 2b17e58
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,26 @@ public void AddAuthorizationInterceptorHandler_WithOptions_ShouldExecuteSuccessf
// Assert
Assert.Null(Record.Exception(act));
}



[Fact]
public void AddAuthorizationInterceptorHandler_WithOptions_ShouldBuildServiceProviderSucessfully()
{
// Arrange
var services = new ServiceCollection();
services.AddHttpClient("Test")
.AddAuthorizationInterceptorHandler<MockAuthorizationInterceptorAuthenticationHandler>(options =>
{
options.UseCustomInterceptor<MockAuthorizationInterceptor>();
});

// Act
var provider = services.BuildServiceProvider();
var httpClientFactory = provider.GetRequiredService<IHttpClientFactory>();
var act = () => httpClientFactory.CreateClient("Test");

// Assert
Assert.Null(Record.Exception(act));
}
}

0 comments on commit 2b17e58

Please sign in to comment.