Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
Increase coverage and fix line endings
Browse files Browse the repository at this point in the history
  • Loading branch information
Ndiritu committed Apr 23, 2024
1 parent ab44d5b commit 0651181
Showing 1 changed file with 24 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using System.Linq;
using System.Net;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using Microsoft.Kiota.Http.HttpClientLibrary.Middleware;
using Microsoft.Kiota.Http.HttpClientLibrary.Middleware;
using Microsoft.Kiota.Http.HttpClientLibrary.Tests.Mocks;
using Xunit;

Expand Down Expand Up @@ -84,21 +86,24 @@ public void GetDefaultHttpMessageHandlerSetsUpProxy()
#endif

}

[Fact]
public void CreateWithNullOrEmptyHandlersReturnsHttpClient()
{
var client = KiotaClientFactory.Create(null);
Assert.IsType<HttpClient>(client);
}

[Fact]
public void CreateWithCustomMiddlewarePipelineReturnsHttpClient()
{
var handlers = KiotaClientFactory.CreateDefaultHandlers();
handlers.Add(new CompressionHandler());
var client = KiotaClientFactory.Create(handlers);
Assert.IsType<HttpClient>(client);
}

[Fact]
public void CreateWithNullOrEmptyHandlersReturnsHttpClient()
{
var client = KiotaClientFactory.Create(null, null);
Assert.IsType<HttpClient>(client);

client = KiotaClientFactory.Create(new List<DelegatingHandler>());
Assert.IsType<HttpClient>(client);
}

[Fact]
public void CreateWithCustomMiddlewarePipelineReturnsHttpClient()
{
var handlers = KiotaClientFactory.CreateDefaultHandlers();
handlers.Add(new CompressionHandler());
var client = KiotaClientFactory.Create(handlers);
Assert.IsType<HttpClient>(client);
}
}
}

0 comments on commit 0651181

Please sign in to comment.