Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aacebo committed Jan 16, 2024
1 parent b287533 commit 879a019
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Net.Http.Headers;
using System.Reflection;
using Microsoft.Extensions.Configuration;

namespace Microsoft.Teams.AI.Tests.Application
{
Expand All @@ -23,7 +24,8 @@ public void Test_TeamsAdapter_NoDuplicateDefaultHeaders()
{
string version = Assembly.GetAssembly(typeof(TeamsAdapter))?.GetName().Version?.ToString() ?? "";
ProductInfoHeaderValue productInfo = new("teamsai-dotnet", version);
TeamsAdapter adapter = new(new TeamsHttpClientFactory());
ConfigurationBuilder config = new();
TeamsAdapter adapter = new(config.Build(), new TeamsHttpClientFactory());
Assert.NotNull(adapter.HttpClientFactory);

HttpClient client = adapter.HttpClientFactory.CreateClient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ public class TeamsAdapter : CloudAdapter
/// <summary>
/// Initializes a new instance of the <see cref="TeamsAdapter"/> class. (Public cloud. No auth. For testing.)
/// </summary>
public TeamsAdapter(IHttpClientFactory? httpClientFactory = null) : base()
public TeamsAdapter() : base()
{
HttpClientFactory = new TeamsHttpClientFactory(httpClientFactory);
HttpClientFactory = new TeamsHttpClientFactory();
}

/// <summary>
Expand Down

0 comments on commit 879a019

Please sign in to comment.