Skip to content

Commit 7f9c518

Browse files
committed
packages update
1 parent f592cf2 commit 7f9c518

File tree

6 files changed

+55
-43
lines changed

6 files changed

+55
-43
lines changed

package.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</PropertyGroup>
2424

2525
<ItemGroup Condition="'$(Configuration)' == 'Release'">
26-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.*" PrivateAssets="All" />
26+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.*" PrivateAssets="All" />
2727
</ItemGroup>
2828

2929
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">

test/ResponseCaching.Test.WebHost/ResponseCaching.Test.WebHost.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="IdentityModel" Version="5.*" />
13+
<PackageReference Include="IdentityModel" Version="6.*" />
1414
</ItemGroup>
1515

1616
<ItemGroup Condition="'$(Configuration)' == 'DEBUG'">

test/ResponseCaching.Test/Base/TestCutureHttpClientFactory.cs

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
using System;
2+
using System.Net.Http;
3+
4+
using Cuture.Http;
5+
6+
namespace ResponseCaching.Test.Base;
7+
8+
internal class TestCutureHttpMessageInvokerPool : IHttpMessageInvokerPool
9+
{
10+
#region Private 字段
11+
12+
private readonly HttpClient _testHttpClient;
13+
14+
private readonly HttpMessageInvokerOwner _testHttpClientOwner;
15+
16+
#endregion Private 字段
17+
18+
#region Public 构造函数
19+
20+
public TestCutureHttpMessageInvokerPool(HttpClient testHttpClient)
21+
{
22+
_testHttpClient = testHttpClient ?? throw new ArgumentNullException(nameof(testHttpClient));
23+
_testHttpClientOwner = new(_testHttpClient);
24+
}
25+
26+
#endregion Public 构造函数
27+
28+
#region Public 方法
29+
30+
public void Dispose()
31+
{
32+
}
33+
34+
public IOwner<HttpMessageInvoker> Rent(IHttpRequest request) => _testHttpClientOwner;
35+
36+
#endregion Public 方法
37+
38+
#region Private 类
39+
40+
private record class HttpMessageInvokerOwner(HttpMessageInvoker Value) : IOwner<HttpMessageInvoker>
41+
{
42+
#region Public 方法
43+
44+
public void Dispose() { }
45+
46+
#endregion Public 方法
47+
}
48+
49+
#endregion Private 类
50+
}

test/ResponseCaching.Test/Base/WebServerHostedTestBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public virtual async Task InitAsync()
4949
await ConfigureWebHost(hostBuilder);
5050
WebHost = await hostBuilder.StartAsync();
5151

52-
HttpRequestGlobalOptions.DefaultHttpMessageInvokerFactory = new TestCutureHttpClientFactory(WebHost.GetTestClient());
52+
HttpRequestGlobalOptions.DefaultHttpMessageInvokerPool = new TestCutureHttpMessageInvokerPool(WebHost.GetTestClient());
5353

5454
HttpRequestGlobalOptions.DefaultConnectionLimit = 500;
5555
}

test/ResponseCaching.Test/ResponseCaching.Test.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Cuture.Http" Version="2.1.1" />
8+
<PackageReference Include="Cuture.Http" Version="2.*" />
99
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.*" />
1010
<PackageReference Include="MSTest.TestAdapter" Version="3.*" />
1111
<PackageReference Include="MSTest.TestFramework" Version="3.*" />
12-
<PackageReference Include="coverlet.collector" Version="3.*">
12+
<PackageReference Include="coverlet.collector" Version="6.*">
1313
<PrivateAssets>all</PrivateAssets>
1414
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1515
</PackageReference>

0 commit comments

Comments
 (0)