Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove .NET 7 since this is now EOL #108

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ env:
DOTNET_NOLOGO: true
dotnet-version: |
8.0.x
7.0.x
6.0.x
5.0.x
3.1.x
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ env:
DOTNET_NOLOGO: true
dotnet-version: |
8.0.x
7.0.x
6.0.x
5.0.x
3.1.x
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ env:
DOTNET_NOLOGO: true
dotnet-version: |
8.0.x
7.0.x
6.0.x
5.0.x
3.1.x
Expand Down
14 changes: 7 additions & 7 deletions examples/Minimal API/MyWebApp.Tests/MyWebApp.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="skwas.MockHttp.Json" Version="4.0.1" />
<PackageReference Include="skwas.MockHttp.Server" Version="4.0.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.8" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="skwas.MockHttp.Json" Version="4.3.1" />
<PackageReference Include="skwas.MockHttp.Server" Version="4.3.1" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions examples/Minimal API/MyWebApp.Tests/SmokeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public async Task TestEndpoint()
// Configure HTTP mock.
using MockHttpHandler mockHttpHandler = HttpMocks.CreateMyClientMock();
// We create a server with automatic port binding (0) on localhost, but you may also define a static port. Note that the port must be free!
using var mockHttpServer = new MockHttpServer(mockHttpHandler, "http://127.0.0.1:0");
await using var mockHttpServer = new MockHttpServer(mockHttpHandler, new Uri("http://127.0.0.1:0"));

await mockHttpServer.StartAsync();

Expand All @@ -33,7 +33,7 @@ public async Task TestEndpoint()
// Here we override the base URL configured for the API client with the one from the server stub.
builder.ConfigureServices(services => services
// ReSharper disable once AccessToDisposedClosure
.Configure<MyClientOptions>(opts => opts.BaseUrl = new Uri(mockHttpServer.HostUrl))
.Configure<MyClientOptions>(opts => opts.BaseUrl = mockHttpServer.HostUri)
);
});

Expand Down
2 changes: 1 addition & 1 deletion examples/Minimal API/MyWebApp/MyWebApp.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<PreserveCompilationContext>true</PreserveCompilationContext>
Expand Down
2 changes: 1 addition & 1 deletion src/MockHttp.Json/MockHttp.Json.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net7.0;net6.0;netstandard2.1;netstandard2.0;net48;net472;net462</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0;netstandard2.1;netstandard2.0;net48;net472;net462</TargetFrameworks>
<PackageId>skwas.MockHttp.Json</PackageId>
<AssemblyName>skwas.MockHttp.Json</AssemblyName>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/MockHttp.Server/MockHttp.Server.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net7.0;net6.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0;netcoreapp3.1</TargetFrameworks>
<PackageId>skwas.MockHttp.Server</PackageId>
<AssemblyName>skwas.MockHttp.Server</AssemblyName>
<RootNamespace>MockHttp</RootNamespace>
Expand Down
2 changes: 1 addition & 1 deletion src/MockHttp/Matchers/Patterns/RegexPatternMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
{
public RegexPatternMatcher
(
#if NET7_0_OR_GREATER
#if NET8_0_OR_GREATER
[StringSyntax(StringSyntaxAttribute.Regex)]
#endif
string regex
)
: this(new Regex(regex, RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.Singleline))

Check warning on line 15 in src/MockHttp/Matchers/Patterns/RegexPatternMatcher.cs

View workflow job for this annotation

GitHub Actions / analysis

Pass a timeout to limit the execution time. (https://rules.sonarsource.com/csharp/RSPEC-6444)

Check warning on line 15 in src/MockHttp/Matchers/Patterns/RegexPatternMatcher.cs

View workflow job for this annotation

GitHub Actions / analysis

Pass a timeout to limit the execution time. (https://rules.sonarsource.com/csharp/RSPEC-6444)

Check warning on line 15 in src/MockHttp/Matchers/Patterns/RegexPatternMatcher.cs

View workflow job for this annotation

GitHub Actions / analysis

Pass a timeout to limit the execution time. (https://rules.sonarsource.com/csharp/RSPEC-6444)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/MockHttp/MockHttp.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net7.0;net6.0;netstandard2.1;netstandard2.0;net48;net472;net462</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0;netstandard2.1;netstandard2.0;net48;net472;net462</TargetFrameworks>
<PackageId>skwas.MockHttp</PackageId>
<AssemblyName>skwas.MockHttp</AssemblyName>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion test/MockHttp.Json.Tests/MockHttp.Json.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net7.0;net6.0;net5.0;netcoreapp3.1;netcoreapp2.1;net48;net472;net462</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0;net5.0;netcoreapp3.1;netcoreapp2.1;net48;net472;net462</TargetFrameworks>

<IsTestProject>true</IsTestProject>

Expand Down
3 changes: 1 addition & 2 deletions test/MockHttp.Server.Tests/MockHttp.Server.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net7.0;net6.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0;netcoreapp3.1</TargetFrameworks>

<IsTestProject>true</IsTestProject>

<RootNamespace>MockHttp</RootNamespace>
<SerilogExtensionsLoggingVersion>8.0.0</SerilogExtensionsLoggingVersion>
<SerilogExtensionsLoggingVersion Condition="$(TargetFramework)=='net7.0'">7.0.0</SerilogExtensionsLoggingVersion>
<SerilogExtensionsLoggingVersion Condition="$(TargetFramework)=='net6.0' Or $(TargetFramework)=='netcoreapp3.1'">3.1.0</SerilogExtensionsLoggingVersion>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion test/MockHttp.Testing/MockHttp.Testing.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net7.0;net6.0;net5.0;netcoreapp3.1;netcoreapp2.1;net48;net472;net462</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0;net5.0;netcoreapp3.1;netcoreapp2.1;net48;net472;net462</TargetFrameworks>

<IsTestProject>false</IsTestProject>

Expand Down
9 changes: 1 addition & 8 deletions test/MockHttp.Tests/Http/HttpHeadersCollectionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,13 @@ public void Given_single_header_string_when_parsing_should_return_key_with_one_o
[InlineData("no-separator", "The value cannot be null or empty.*")]
#if NET8_0_OR_GREATER
[InlineData(":value", "The value cannot be an empty string or composed entirely of whitespace.*")]
#else
[InlineData(":value", "The value cannot be null or empty.*")]
#endif
#if NET7_0_OR_GREATER
#if NET8_0_OR_GREATER
[InlineData(" :value", "The value cannot be an empty string or composed entirely of whitespace.*")]
#else
[InlineData(" :value", "The header name ' ' has an invalid format.")]
#endif
[InlineData(" leading-whitespace-not-allowed:value", "The header name ' leading-whitespace-not-allowed' has an invalid format.")]
[InlineData("\tleading-whitespace-not-allowed:value", "The header name '\tleading-whitespace-not-allowed' has an invalid format.")]
[InlineData("trailing-whitespace-not-allowed :value", "The header name 'trailing-whitespace-not-allowed ' has an invalid format.")]
[InlineData("trailing-whitespace-not-allowed\t:value", "The header name 'trailing-whitespace-not-allowed\t' has an invalid format.")]
#else
[InlineData(":value", "The value cannot be null or empty.*")]
[InlineData(" :value", "The header name format is invalid.")]
[InlineData(" leading-whitespace-not-allowed:value", "The header name format is invalid.")]
[InlineData("\tleading-whitespace-not-allowed:value", "The header name format is invalid.")]
Expand Down
2 changes: 1 addition & 1 deletion test/MockHttp.Tests/MockHttp.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net7.0;net6.0;net5.0;netcoreapp3.1;netcoreapp2.1;net48;net472;net462</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0;net5.0;netcoreapp3.1;netcoreapp2.1;net48;net472;net462</TargetFrameworks>

<IsTestProject>true</IsTestProject>

Expand Down
Loading