From 38b3296774e83b313387275855e3e7d24313faf1 Mon Sep 17 00:00:00 2001 From: martincostello Date: Thu, 17 Feb 2022 19:14:33 +0000 Subject: [PATCH 01/13] Update to .NET 7 preview 1 Update to preview 1 of .NET 7. --- .github/workflows/build.yml | 2 +- .vscode/launch.json | 2 +- .vsconfig | 2 +- Directory.Packages.props | 4 ++-- README.md | 2 +- global.json | 2 +- samples/SampleApp.Tests/SampleApp.Tests.csproj | 2 +- samples/SampleApp/SampleApp.csproj | 2 +- .../JustEat.HttpClientInterception.Benchmarks.csproj | 2 +- .../JustEat.HttpClientInterception.Tests.csproj | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 74493cd7..4e9bd87a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,7 +46,7 @@ jobs: - uses: codecov/codecov-action@v3 name: Upload coverage to Codecov with: - file: ./artifacts/coverage.net6.0.cobertura.xml + file: ./artifacts/coverage.net7.0.cobertura.xml flags: ${{ matrix.os_name }} - name: Publish artifacts diff --git a/.vscode/launch.json b/.vscode/launch.json index 1c6b35e1..7c66af5a 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -6,7 +6,7 @@ "type": "coreclr", "request": "launch", "preLaunchTask": "build", - "program": "${workspaceFolder}/samples/SampleApp/bin/Debug/net6.0/SampleApp.dll", + "program": "${workspaceFolder}/samples/SampleApp/bin/Debug/net7.0/SampleApp.dll", "args": [], "cwd": "${workspaceFolder}/samples/SampleApp", "stopAtEntry": false, diff --git a/.vsconfig b/.vsconfig index ab008c3f..06e10617 100644 --- a/.vsconfig +++ b/.vsconfig @@ -3,7 +3,7 @@ "components": [ "Microsoft.VisualStudio.Component.CoreEditor", "Microsoft.VisualStudio.Workload.CoreEditor", - "Microsoft.NetCore.Component.Runtime.6.0", + "Microsoft.NetCore.Component.Runtime.7.0", "Microsoft.NetCore.Component.SDK", "Microsoft.VisualStudio.Component.Roslyn.Compiler", "Microsoft.VisualStudio.Component.Roslyn.LanguageServices" diff --git a/Directory.Packages.props b/Directory.Packages.props index f426038d..a9bca73a 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,7 +5,7 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/README.md b/README.md index 6ef4a590..dc7f187e 100644 --- a/README.md +++ b/README.md @@ -282,7 +282,7 @@ The repository is hosted in [GitHub](https://github.com/justeat/httpclient-inter ## Building and Testing -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). +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). To build and test the library locally from a terminal/command-line, run one of the following set of commands: diff --git a/global.json b/global.json index daf2d40d..7fd929c4 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.403", + "version": "7.0.100-preview.1.22110.4", "allowPrerelease": false, "rollForward": "latestMajor" } diff --git a/samples/SampleApp.Tests/SampleApp.Tests.csproj b/samples/SampleApp.Tests/SampleApp.Tests.csproj index bb8e7090..70224130 100644 --- a/samples/SampleApp.Tests/SampleApp.Tests.csproj +++ b/samples/SampleApp.Tests/SampleApp.Tests.csproj @@ -2,7 +2,7 @@ true $(NoWarn);CA1056;CA1062;CA1707;CA1711;CA2007;SA1600 - net6.0 + net7.0 diff --git a/samples/SampleApp/SampleApp.csproj b/samples/SampleApp/SampleApp.csproj index fba3d39d..e09d5c17 100644 --- a/samples/SampleApp/SampleApp.csproj +++ b/samples/SampleApp/SampleApp.csproj @@ -2,7 +2,7 @@ inprocess $(NoWarn);CA1062;CA2007;SA1600 - net6.0 + net7.0 diff --git a/tests/HttpClientInterception.Benchmarks/JustEat.HttpClientInterception.Benchmarks.csproj b/tests/HttpClientInterception.Benchmarks/JustEat.HttpClientInterception.Benchmarks.csproj index 218c677e..eb82a5a4 100644 --- a/tests/HttpClientInterception.Benchmarks/JustEat.HttpClientInterception.Benchmarks.csproj +++ b/tests/HttpClientInterception.Benchmarks/JustEat.HttpClientInterception.Benchmarks.csproj @@ -5,7 +5,7 @@ Exe JustEat.HttpClientInterception Benchmarks for JustEat.HttpClientInterception - netcoreapp3.1;net472;net6.0 + netcoreapp3.1;net472;net6.0;net7.0 diff --git a/tests/HttpClientInterception.Tests/JustEat.HttpClientInterception.Tests.csproj b/tests/HttpClientInterception.Tests/JustEat.HttpClientInterception.Tests.csproj index 11299ccd..8042d72c 100644 --- a/tests/HttpClientInterception.Tests/JustEat.HttpClientInterception.Tests.csproj +++ b/tests/HttpClientInterception.Tests/JustEat.HttpClientInterception.Tests.csproj @@ -5,7 +5,7 @@ $(NoWarn);CA1303;CA1600;CA1707;CA1812;CA2000;CA2007;SA1600 JustEat.HttpClientInterception Tests for JustEat.HttpClientInterception - net6.0 + net7.0 From bd8a8429d354eb51a57991306cce34670e767711 Mon Sep 17 00:00:00 2001 From: martincostello Date: Tue, 15 Mar 2022 19:15:48 +0000 Subject: [PATCH 02/13] Update to .NET 7 preview 2 Update to preview 2 of .NET 7. --- Directory.Packages.props | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index a9bca73a..0e6d52b8 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,7 +5,7 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/global.json b/global.json index 7fd929c4..66498419 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.100-preview.1.22110.4", + "version": "7.0.100-preview.2.22153.17", "allowPrerelease": false, "rollForward": "latestMajor" } From 24b62fa13516c43b8dc8aa5f918b5895eb197d1a Mon Sep 17 00:00:00 2001 From: martincostello Date: Wed, 13 Apr 2022 17:49:20 +0100 Subject: [PATCH 03/13] Update to .NET 7 preview 3 Update to preview 3 of .NET 7. --- Directory.Packages.props | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 0e6d52b8..1d45c3d8 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,7 +5,7 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/global.json b/global.json index 66498419..d467822b 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.100-preview.2.22153.17", + "version": "7.0.100-preview.3.22179.4", "allowPrerelease": false, "rollForward": "latestMajor" } From c1c6f46d0e4a3257bbb5ff89f699fc789f9ae70d Mon Sep 17 00:00:00 2001 From: martincostello Date: Tue, 10 May 2022 17:17:48 +0100 Subject: [PATCH 04/13] Update to .NET 7 preview 4 Update to preview 4 of .NET 7. --- Directory.Packages.props | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 1d45c3d8..19884fa8 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,7 +5,7 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/global.json b/global.json index d467822b..4377249b 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.100-preview.3.22179.4", + "version": "7.0.100-preview.4.22252.9", "allowPrerelease": false, "rollForward": "latestMajor" } From ee8bdc96272e2fc6247857f585ae602a567a2ef6 Mon Sep 17 00:00:00 2001 From: martincostello Date: Fri, 13 May 2022 10:47:03 +0100 Subject: [PATCH 05/13] Add [StringSyntax] attributes Add [StringSyntax] to overloads, where relevant. Relates to #440. --- .../HttpClientInterceptorOptionsExtensions.cs | 21 +++++++++++++++++-- ...ttpRequestInterceptionBuilderExtensions.cs | 8 ++++++- .../JustEat.HttpClientInterception.csproj | 2 +- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/HttpClientInterception/HttpClientInterceptorOptionsExtensions.cs b/src/HttpClientInterception/HttpClientInterceptorOptionsExtensions.cs index dd180dbb..17ef77f0 100644 --- a/src/HttpClientInterception/HttpClientInterceptorOptionsExtensions.cs +++ b/src/HttpClientInterception/HttpClientInterceptorOptionsExtensions.cs @@ -2,6 +2,7 @@ // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; using System.Net; using System.Text; using System.Text.Json; @@ -25,7 +26,12 @@ public static class HttpClientInterceptorOptionsExtensions /// /// is . /// - public static HttpClient CreateHttpClient(this HttpClientInterceptorOptions options, string baseAddress) + public static HttpClient CreateHttpClient( + this HttpClientInterceptorOptions options, +#if NET7_0_OR_GREATER + [StringSyntax("Uri")] +#endif + string baseAddress) { var baseAddressUri = new Uri(baseAddress, UriKind.RelativeOrAbsolute); return options.CreateHttpClient(baseAddressUri); @@ -186,6 +192,9 @@ public static HttpClientInterceptorOptions RegisterStream( /// public static HttpClientInterceptorOptions RegisterGetJson( this HttpClientInterceptorOptions options, +#if NET7_0_OR_GREATER + [StringSyntax("Uri")] +#endif string uriString, object content, HttpStatusCode statusCode = HttpStatusCode.OK) @@ -225,6 +234,9 @@ byte[] ContentFactory() /// public static HttpClientInterceptorOptions RegisterGet( this HttpClientInterceptorOptions options, +#if NET7_0_OR_GREATER + [StringSyntax("Uri")] +#endif string uriString, string content, HttpStatusCode statusCode = HttpStatusCode.OK, @@ -254,7 +266,12 @@ public static HttpClientInterceptorOptions RegisterGet( /// /// is . /// - public static HttpClientInterceptorOptions DeregisterGet(this HttpClientInterceptorOptions options, string uriString) + public static HttpClientInterceptorOptions DeregisterGet( + this HttpClientInterceptorOptions options, +#if NET7_0_OR_GREATER + [StringSyntax("Uri")] +#endif + string uriString) { if (options is null) { diff --git a/src/HttpClientInterception/HttpRequestInterceptionBuilderExtensions.cs b/src/HttpClientInterception/HttpRequestInterceptionBuilderExtensions.cs index 2cb5c4bb..4d4483fc 100644 --- a/src/HttpClientInterception/HttpRequestInterceptionBuilderExtensions.cs +++ b/src/HttpClientInterception/HttpRequestInterceptionBuilderExtensions.cs @@ -2,6 +2,7 @@ // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; using System.Text; using Microsoft.AspNetCore.WebUtilities; @@ -219,7 +220,12 @@ public static HttpRequestInterceptionBuilder WithJsonContent( /// /// is . /// - public static HttpRequestInterceptionBuilder ForUrl(this HttpRequestInterceptionBuilder builder, string uriString) + public static HttpRequestInterceptionBuilder ForUrl( + this HttpRequestInterceptionBuilder builder, +#if NET7_0_OR_GREATER + [StringSyntax("Uri")] +#endif + string uriString) { if (builder is null) { diff --git a/src/HttpClientInterception/JustEat.HttpClientInterception.csproj b/src/HttpClientInterception/JustEat.HttpClientInterception.csproj index bd568788..2d59c6ba 100644 --- a/src/HttpClientInterception/JustEat.HttpClientInterception.csproj +++ b/src/HttpClientInterception/JustEat.HttpClientInterception.csproj @@ -12,7 +12,7 @@ JustEat.HttpClientInterception true A .NET library for intercepting server-side HTTP dependencies. - netstandard2.0;net472;net6.0 + netstandard2.0;net472;net6.0;net7.0 From 411370e337e5271f62e261cee73daadf57f97087 Mon Sep 17 00:00:00 2001 From: martincostello Date: Fri, 13 May 2022 11:50:11 +0100 Subject: [PATCH 06/13] Use StringSyntaxAttribute.Uri constant Use the StringSyntaxAttribute.Uri constant instead of magic strings. --- .../HttpClientInterceptorOptionsExtensions.cs | 8 ++++---- .../HttpRequestInterceptionBuilderExtensions.cs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/HttpClientInterception/HttpClientInterceptorOptionsExtensions.cs b/src/HttpClientInterception/HttpClientInterceptorOptionsExtensions.cs index 17ef77f0..13322542 100644 --- a/src/HttpClientInterception/HttpClientInterceptorOptionsExtensions.cs +++ b/src/HttpClientInterception/HttpClientInterceptorOptionsExtensions.cs @@ -29,7 +29,7 @@ public static class HttpClientInterceptorOptionsExtensions public static HttpClient CreateHttpClient( this HttpClientInterceptorOptions options, #if NET7_0_OR_GREATER - [StringSyntax("Uri")] + [StringSyntax(StringSyntaxAttribute.Uri)] #endif string baseAddress) { @@ -193,7 +193,7 @@ public static HttpClientInterceptorOptions RegisterStream( public static HttpClientInterceptorOptions RegisterGetJson( this HttpClientInterceptorOptions options, #if NET7_0_OR_GREATER - [StringSyntax("Uri")] + [StringSyntax(StringSyntaxAttribute.Uri)] #endif string uriString, object content, @@ -235,7 +235,7 @@ byte[] ContentFactory() public static HttpClientInterceptorOptions RegisterGet( this HttpClientInterceptorOptions options, #if NET7_0_OR_GREATER - [StringSyntax("Uri")] + [StringSyntax(StringSyntaxAttribute.Uri)] #endif string uriString, string content, @@ -269,7 +269,7 @@ public static HttpClientInterceptorOptions RegisterGet( public static HttpClientInterceptorOptions DeregisterGet( this HttpClientInterceptorOptions options, #if NET7_0_OR_GREATER - [StringSyntax("Uri")] + [StringSyntax(StringSyntaxAttribute.Uri)] #endif string uriString) { diff --git a/src/HttpClientInterception/HttpRequestInterceptionBuilderExtensions.cs b/src/HttpClientInterception/HttpRequestInterceptionBuilderExtensions.cs index 4d4483fc..3a234754 100644 --- a/src/HttpClientInterception/HttpRequestInterceptionBuilderExtensions.cs +++ b/src/HttpClientInterception/HttpRequestInterceptionBuilderExtensions.cs @@ -223,7 +223,7 @@ public static HttpRequestInterceptionBuilder WithJsonContent( public static HttpRequestInterceptionBuilder ForUrl( this HttpRequestInterceptionBuilder builder, #if NET7_0_OR_GREATER - [StringSyntax("Uri")] + [StringSyntax(StringSyntaxAttribute.Uri)] #endif string uriString) { From 35fd06270f29c3557a4aa3e2b8cf621d0e9b5ce9 Mon Sep 17 00:00:00 2001 From: martincostello Date: Tue, 17 May 2022 10:55:25 +0100 Subject: [PATCH 07/13] Support [StringSyntax] for all TFMs Compile an internal version of StringSyntaxAttribute to support use with TFMs prior to .NET 7. Resolves #440. --- .../HttpClientInterceptorOptionsExtensions.cs | 8 ----- ...ttpRequestInterceptionBuilderExtensions.cs | 2 -- .../StringSyntaxAttribute.cs | 30 +++++++++++++++++++ 3 files changed, 30 insertions(+), 10 deletions(-) create mode 100644 src/HttpClientInterception/StringSyntaxAttribute.cs diff --git a/src/HttpClientInterception/HttpClientInterceptorOptionsExtensions.cs b/src/HttpClientInterception/HttpClientInterceptorOptionsExtensions.cs index 13322542..4e0776dd 100644 --- a/src/HttpClientInterception/HttpClientInterceptorOptionsExtensions.cs +++ b/src/HttpClientInterception/HttpClientInterceptorOptionsExtensions.cs @@ -28,9 +28,7 @@ public static class HttpClientInterceptorOptionsExtensions /// public static HttpClient CreateHttpClient( this HttpClientInterceptorOptions options, -#if NET7_0_OR_GREATER [StringSyntax(StringSyntaxAttribute.Uri)] -#endif string baseAddress) { var baseAddressUri = new Uri(baseAddress, UriKind.RelativeOrAbsolute); @@ -192,9 +190,7 @@ public static HttpClientInterceptorOptions RegisterStream( /// public static HttpClientInterceptorOptions RegisterGetJson( this HttpClientInterceptorOptions options, -#if NET7_0_OR_GREATER [StringSyntax(StringSyntaxAttribute.Uri)] -#endif string uriString, object content, HttpStatusCode statusCode = HttpStatusCode.OK) @@ -234,9 +230,7 @@ byte[] ContentFactory() /// public static HttpClientInterceptorOptions RegisterGet( this HttpClientInterceptorOptions options, -#if NET7_0_OR_GREATER [StringSyntax(StringSyntaxAttribute.Uri)] -#endif string uriString, string content, HttpStatusCode statusCode = HttpStatusCode.OK, @@ -268,9 +262,7 @@ public static HttpClientInterceptorOptions RegisterGet( /// public static HttpClientInterceptorOptions DeregisterGet( this HttpClientInterceptorOptions options, -#if NET7_0_OR_GREATER [StringSyntax(StringSyntaxAttribute.Uri)] -#endif string uriString) { if (options is null) diff --git a/src/HttpClientInterception/HttpRequestInterceptionBuilderExtensions.cs b/src/HttpClientInterception/HttpRequestInterceptionBuilderExtensions.cs index 3a234754..6b2483de 100644 --- a/src/HttpClientInterception/HttpRequestInterceptionBuilderExtensions.cs +++ b/src/HttpClientInterception/HttpRequestInterceptionBuilderExtensions.cs @@ -222,9 +222,7 @@ public static HttpRequestInterceptionBuilder WithJsonContent( /// public static HttpRequestInterceptionBuilder ForUrl( this HttpRequestInterceptionBuilder builder, -#if NET7_0_OR_GREATER [StringSyntax(StringSyntaxAttribute.Uri)] -#endif string uriString) { if (builder is null) diff --git a/src/HttpClientInterception/StringSyntaxAttribute.cs b/src/HttpClientInterception/StringSyntaxAttribute.cs new file mode 100644 index 00000000..b12077c3 --- /dev/null +++ b/src/HttpClientInterception/StringSyntaxAttribute.cs @@ -0,0 +1,30 @@ +// Copyright (c) Just Eat, 2017. All rights reserved. +// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. + +//// Based on https://github.com/dotnet/runtime/blob/65067052e433eda400c5e7cc9f7b21c84640f901/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/StringSyntaxAttribute.cs + +#if !NET7_0_OR_GREATER +namespace System.Diagnostics.CodeAnalysis; + +[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)] +internal sealed class StringSyntaxAttribute : Attribute +{ + public const string Uri = nameof(Uri); + + public StringSyntaxAttribute(string syntax) + { + Syntax = syntax; + Arguments = Array.Empty(); + } + + public StringSyntaxAttribute(string syntax, params object?[] arguments) + { + Syntax = syntax; + Arguments = arguments; + } + + public string Syntax { get; } + + public object?[] Arguments { get; } +} +#endif From 49f83b8b226b2b36e09b31858e99c070f08b0f7f Mon Sep 17 00:00:00 2001 From: martincostello Date: Tue, 14 Jun 2022 16:13:23 +0100 Subject: [PATCH 08/13] Update to .NET 7 preview 5 Update to preview 5 of .NET 7. --- Directory.Packages.props | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 19884fa8..4a5973a1 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,7 +5,7 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/global.json b/global.json index 4377249b..65d83b71 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.100-preview.4.22252.9", + "version": "7.0.100-preview.5.22307.18", "allowPrerelease": false, "rollForward": "latestMajor" } From 3b2b3c100165f7a03aad7e9a9f91ad9c626527ac Mon Sep 17 00:00:00 2001 From: martincostello Date: Tue, 12 Jul 2022 18:06:11 +0100 Subject: [PATCH 09/13] Update to .NET 7 preview 6 Update to preview 6 of .NET 7. --- Directory.Packages.props | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 4a5973a1..edb4d592 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,7 +5,7 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/global.json b/global.json index 65d83b71..6298aa41 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.100-preview.5.22307.18", + "version": "7.0.100-preview.6.22352.1", "allowPrerelease": false, "rollForward": "latestMajor" } From d8a871bc7f7479d0bb33db5a706f0fb4fb8407f7 Mon Sep 17 00:00:00 2001 From: martincostello Date: Tue, 9 Aug 2022 15:53:43 +0100 Subject: [PATCH 10/13] Update to .NET 7 preview 7 Update to preview 7 of .NET 7. --- Directory.Packages.props | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index edb4d592..6a757dd9 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,7 +5,7 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/global.json b/global.json index 6298aa41..fdfda88b 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.100-preview.6.22352.1", + "version": "7.0.100-preview.7.22377.5", "allowPrerelease": false, "rollForward": "latestMajor" } From e28e3bbf9ef77f5f296b35d033e98157e3555f1b Mon Sep 17 00:00:00 2001 From: martincostello Date: Wed, 14 Sep 2022 15:33:42 +0100 Subject: [PATCH 11/13] Update to .NET 7 RC1 Update to release candidate 1 of .NET 7. --- Directory.Packages.props | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 6a757dd9..a4f915a5 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,7 +5,7 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/global.json b/global.json index fdfda88b..a3f52cf7 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.100-preview.7.22377.5", + "version": "7.0.100-rc.1.22431.12", "allowPrerelease": false, "rollForward": "latestMajor" } From c0396c67973d2bde977649d4f0bd7cb9e353998c Mon Sep 17 00:00:00 2001 From: martincostello Date: Tue, 11 Oct 2022 18:46:51 +0100 Subject: [PATCH 12/13] Update to .NET 7 RC2 Update to release candidate 2 of .NET 7. --- Directory.Packages.props | 4 ++-- global.json | 2 +- .../HttpRequestInterceptionBuilderTests.cs | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index a4f915a5..d02b79d1 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,7 +5,7 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/global.json b/global.json index a3f52cf7..54125015 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.100-rc.1.22431.12", + "version": "7.0.100-rc.2.22477.23", "allowPrerelease": false, "rollForward": "latestMajor" } diff --git a/tests/HttpClientInterception.Tests/HttpRequestInterceptionBuilderTests.cs b/tests/HttpClientInterception.Tests/HttpRequestInterceptionBuilderTests.cs index ae8ad373..cffec69b 100644 --- a/tests/HttpClientInterception.Tests/HttpRequestInterceptionBuilderTests.cs +++ b/tests/HttpClientInterception.Tests/HttpRequestInterceptionBuilderTests.cs @@ -229,7 +229,7 @@ public static async Task Builder_For_Raw_Bytes_Registers_Interception_Synchronou var builder = new HttpRequestInterceptionBuilder() .ForUrl(requestUri) - .WithContent(() => new byte[] { 46, 78, 69, 84 }); + .WithContent(() => ".NET"u8.ToArray()); var options = new HttpClientInterceptorOptions().Register(builder); @@ -248,7 +248,7 @@ public static async Task Builder_For_Raw_Bytes_Clears_Content() var builder = new HttpRequestInterceptionBuilder() .ForUrl(requestUri) - .WithContent(() => new byte[] { 46, 78, 69, 84 }) + .WithContent(() => ".NET"u8.ToArray()) .WithContent((Func)null) .WithContent((Func>)null); @@ -269,8 +269,8 @@ public static async Task Builder_For_Raw_Bytes_Registers_Interception_Asynchrono var builder = new HttpRequestInterceptionBuilder() .ForUrl(requestUri) - .WithContentStream(() => Task.FromResult(new MemoryStream(new byte[] { 84, 69, 78, 46 }))) - .WithContent(() => Task.FromResult(new byte[] { 46, 78, 69, 84 })); + .WithContentStream(() => Task.FromResult(new MemoryStream(".NET"u8.ToArray()))) + .WithContent(() => Task.FromResult(".NET"u8.ToArray())); var options = new HttpClientInterceptorOptions().Register(builder); @@ -289,7 +289,7 @@ public static async Task Builder_For_Stream_Registers_Interception_Synchronous() var builder = new HttpRequestInterceptionBuilder() .ForUrl(requestUri) - .WithContentStream(() => new MemoryStream(new byte[] { 46, 78, 69, 84 })); + .WithContentStream(() => new MemoryStream(".NET"u8.ToArray())); var options = new HttpClientInterceptorOptions().Register(builder); @@ -308,7 +308,7 @@ public static async Task Builder_For_Stream_Clears_Stream() var builder = new HttpRequestInterceptionBuilder() .ForUrl(requestUri) - .WithContentStream(() => new MemoryStream(new byte[] { 46, 78, 69, 84 })) + .WithContentStream(() => new MemoryStream(".NET"u8.ToArray())) .WithContentStream((Func)null) .WithContentStream((Func>)null); @@ -329,8 +329,8 @@ public static async Task Builder_For_Stream_Registers_Interception_Asynchronous( var builder = new HttpRequestInterceptionBuilder() .ForUrl(requestUri) - .WithContent(() => Task.FromResult(new byte[] { 84, 69, 78, 46 })) - .WithContentStream(() => Task.FromResult(new MemoryStream(new byte[] { 46, 78, 69, 84 }))); + .WithContent(() => Task.FromResult(".NET"u8.ToArray())) + .WithContentStream(() => Task.FromResult(new MemoryStream(".NET"u8.ToArray()))); var options = new HttpClientInterceptorOptions().Register(builder); From 9d4cb8476178dee7ccb8de96e25a0d0062e21bf5 Mon Sep 17 00:00:00 2001 From: martincostello Date: Mon, 7 Nov 2022 18:52:17 +0000 Subject: [PATCH 13/13] Update to .NET 7 Update to the stable release of .NET 7. --- Directory.Packages.props | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index d02b79d1..db38b891 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,7 +5,7 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/global.json b/global.json index 54125015..e6ab3173 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.100-rc.2.22477.23", + "version": "7.0.100", "allowPrerelease": false, "rollForward": "latestMajor" }