Add support for .NET 7.0

This commit is contained in:
Patrik Svensson
2022-11-09 06:58:39 +01:00
committed by Patrik Svensson
parent 02f9d26473
commit 7dce4af552
64 changed files with 91 additions and 93 deletions

View File

@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows'))">net6.0;net48</TargetFrameworks>
<TargetFrameworks Condition="!$([MSBuild]::IsOSPlatform('Windows'))">net6.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows'))">net7.0;net48</TargetFrameworks>
<TargetFrameworks Condition="!$([MSBuild]::IsOSPlatform('Windows'))">net7.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
@ -18,10 +18,9 @@
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit" Version="1.1.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.XUnit" Version="1.1.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="2.6.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="Shouldly" Version="4.0.3" />
<PackageReference Include="Spectre.Verify.Extensions" Version="17.1.6" />
<PackageReference Include="Verify.Xunit" Version="17.1.6" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageReference Include="Shouldly" Version="4.1.0" />
<PackageReference Include="Spectre.Verify.Extensions" Version="18.0.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PrivateAssets>all</PrivateAssets>

View File

@ -302,7 +302,7 @@ public sealed class StyleTests
[InlineData("rgb(255)", "Invalid RGB color 'rgb(255)'.")]
[InlineData("rgb(255,255)", "Invalid RGB color 'rgb(255,255)'.")]
[InlineData("rgb(255,255,255", "Invalid RGB color 'rgb(255,255,255'.")]
[InlineData("rgb(A,B,C)", "Invalid RGB color 'rgb(A,B,C)'. Input string was not in a correct format.")]
[InlineData("rgb(A,B,C)", "Invalid RGB color 'rgb(A,B,C)'.")]
public void Should_Return_Error_If_Rgb_Color_Is_Invalid(string style, string expected)
{
// Given, When
@ -310,7 +310,7 @@ public sealed class StyleTests
// Then
result.ShouldNotBeNull();
result.Message.ShouldBe(expected);
result.Message.ShouldStartWith(expected);
}
}

View File

@ -1,4 +1,4 @@
#if !NET5_0_OR_GREATER
#if !NET6_0_OR_GREATER
namespace System.Runtime.CompilerServices;
[AttributeUsage(AttributeTargets.Method, Inherited = false)]

View File

@ -5,6 +5,6 @@ public static class VerifyConfiguration
[ModuleInitializer]
public static void Init()
{
VerifierSettings.DerivePathInfo(Expectations.Initialize);
Verifier.DerivePathInfo(Expectations.Initialize);
}
}