Skip to content

Commit 77a6bb9

Browse files
Merge pull request #402 from martincostello/DotNet-7
Update to .NET 7
2 parents 6bf66b0 + 9d4cb84 commit 77a6bb9

File tree

15 files changed

+66
-23
lines changed

15 files changed

+66
-23
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- uses: codecov/codecov-action@v3
4747
name: Upload coverage to Codecov
4848
with:
49-
file: ./artifacts/coverage.net6.0.cobertura.xml
49+
file: ./artifacts/coverage.net7.0.cobertura.xml
5050
flags: ${{ matrix.os_name }}
5151

5252
- name: Publish artifacts

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"type": "coreclr",
77
"request": "launch",
88
"preLaunchTask": "build",
9-
"program": "${workspaceFolder}/samples/SampleApp/bin/Debug/net6.0/SampleApp.dll",
9+
"program": "${workspaceFolder}/samples/SampleApp/bin/Debug/net7.0/SampleApp.dll",
1010
"args": [],
1111
"cwd": "${workspaceFolder}/samples/SampleApp",
1212
"stopAtEntry": false,

.vsconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"components": [
44
"Microsoft.VisualStudio.Component.CoreEditor",
55
"Microsoft.VisualStudio.Workload.CoreEditor",
6-
"Microsoft.NetCore.Component.Runtime.6.0",
6+
"Microsoft.NetCore.Component.Runtime.7.0",
77
"Microsoft.NetCore.Component.SDK",
88
"Microsoft.VisualStudio.Component.Roslyn.Compiler",
99
"Microsoft.VisualStudio.Component.Roslyn.LanguageServices"

Directory.Packages.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<PackageVersion Include="GitHubActionsTestLogger" Version="2.0.1" />
66
<PackageVersion Include="MarkdownSnippets.MsBuild" Version="24.5.0" />
77
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.3.0" />
8-
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.10" />
8+
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.0" />
99
<PackageVersion Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" />
1010
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.3" />
1111
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" />
@@ -29,7 +29,7 @@
2929
<PackageVersion Update="System.Text.Json" Version="6.0.0" />
3030
</ItemGroup>
3131
<ItemGroup Condition=" '$(AssemblyName)' != 'JustEat.HttpClientInterception' ">
32-
<PackageVersion Update="System.Text.Json" Version="6.0.6" />
32+
<PackageVersion Update="System.Text.Json" Version="7.0.0" />
3333
</ItemGroup>
3434
<ItemGroup>
3535
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="All" />

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ The repository is hosted in [GitHub](https://github.com/justeat/httpclient-inter
282282

283283
## Building and Testing
284284

285-
Compiling the library yourself requires Git and the [.NET SDK](https://www.microsoft.com/net/download/core "Download the .NET SDK") to be installed (version 6.0.100 or later).
285+
Compiling the library yourself requires Git and the [.NET SDK](https://www.microsoft.com/net/download/core "Download the .NET SDK") to be installed (version 7.0.100 or later).
286286

287287
To build and test the library locally from a terminal/command-line, run one of the following set of commands:
288288

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "6.0.403",
3+
"version": "7.0.100",
44
"allowPrerelease": false,
55
"rollForward": "latestMajor"
66
}

samples/SampleApp.Tests/SampleApp.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<IsTestProject>true</IsTestProject>
44
<NoWarn>$(NoWarn);CA1056;CA1062;CA1707;CA1711;CA2007;SA1600</NoWarn>
5-
<TargetFrameworks>net6.0</TargetFrameworks>
5+
<TargetFrameworks>net7.0</TargetFrameworks>
66
</PropertyGroup>
77
<ItemGroup>
88
<Content Include="testsettings.json;xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />

samples/SampleApp/SampleApp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<AspNetCoreHostingModel>inprocess</AspNetCoreHostingModel>
44
<NoWarn>$(NoWarn);CA1062;CA2007;SA1600</NoWarn>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net7.0</TargetFramework>
66
</PropertyGroup>
77
<ItemGroup>
88
<PackageReference Include="Refit" />

src/HttpClientInterception/HttpClientInterceptorOptionsExtensions.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
33

44
using System.ComponentModel;
5+
using System.Diagnostics.CodeAnalysis;
56
using System.Net;
67
using System.Text;
78
using System.Text.Json;
@@ -25,7 +26,10 @@ public static class HttpClientInterceptorOptionsExtensions
2526
/// <exception cref="ArgumentNullException">
2627
/// <paramref name="options"/> is <see langword="null"/>.
2728
/// </exception>
28-
public static HttpClient CreateHttpClient(this HttpClientInterceptorOptions options, string baseAddress)
29+
public static HttpClient CreateHttpClient(
30+
this HttpClientInterceptorOptions options,
31+
[StringSyntax(StringSyntaxAttribute.Uri)]
32+
string baseAddress)
2933
{
3034
var baseAddressUri = new Uri(baseAddress, UriKind.RelativeOrAbsolute);
3135
return options.CreateHttpClient(baseAddressUri);
@@ -186,6 +190,7 @@ public static HttpClientInterceptorOptions RegisterStream(
186190
/// </exception>
187191
public static HttpClientInterceptorOptions RegisterGetJson(
188192
this HttpClientInterceptorOptions options,
193+
[StringSyntax(StringSyntaxAttribute.Uri)]
189194
string uriString,
190195
object content,
191196
HttpStatusCode statusCode = HttpStatusCode.OK)
@@ -225,6 +230,7 @@ byte[] ContentFactory()
225230
/// </exception>
226231
public static HttpClientInterceptorOptions RegisterGet(
227232
this HttpClientInterceptorOptions options,
233+
[StringSyntax(StringSyntaxAttribute.Uri)]
228234
string uriString,
229235
string content,
230236
HttpStatusCode statusCode = HttpStatusCode.OK,
@@ -254,7 +260,10 @@ public static HttpClientInterceptorOptions RegisterGet(
254260
/// <exception cref="ArgumentNullException">
255261
/// <paramref name="options"/> is <see langword="null"/>.
256262
/// </exception>
257-
public static HttpClientInterceptorOptions DeregisterGet(this HttpClientInterceptorOptions options, string uriString)
263+
public static HttpClientInterceptorOptions DeregisterGet(
264+
this HttpClientInterceptorOptions options,
265+
[StringSyntax(StringSyntaxAttribute.Uri)]
266+
string uriString)
258267
{
259268
if (options is null)
260269
{

src/HttpClientInterception/HttpRequestInterceptionBuilderExtensions.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
33

44
using System.ComponentModel;
5+
using System.Diagnostics.CodeAnalysis;
56
using System.Text;
67
using Microsoft.AspNetCore.WebUtilities;
78

@@ -219,7 +220,10 @@ public static HttpRequestInterceptionBuilder WithJsonContent(
219220
/// <exception cref="ArgumentNullException">
220221
/// <paramref name="builder"/> is <see langword="null"/>.
221222
/// </exception>
222-
public static HttpRequestInterceptionBuilder ForUrl(this HttpRequestInterceptionBuilder builder, string uriString)
223+
public static HttpRequestInterceptionBuilder ForUrl(
224+
this HttpRequestInterceptionBuilder builder,
225+
[StringSyntax(StringSyntaxAttribute.Uri)]
226+
string uriString)
223227
{
224228
if (builder is null)
225229
{

0 commit comments

Comments
 (0)