diff --git a/src/Verify.Tests/Naming/NamerTests.cs b/src/Verify.Tests/Naming/NamerTests.cs index d03e7924bf..466052c205 100644 --- a/src/Verify.Tests/Naming/NamerTests.cs +++ b/src/Verify.Tests/Naming/NamerTests.cs @@ -584,7 +584,6 @@ public Task FrameworkName() }) .UniqueForRuntimeAndVersion(); } -#if NET6_0_OR_GREATER || NETFRAMEWORK [Theory] [InlineData(true, false)] @@ -621,5 +620,4 @@ public Task HashParametersFluent(bool a, bool b) => Verify("ContentHashParametersFluent") .UseHashedParameters(a, b) .HashParameters(); -#endif } \ No newline at end of file diff --git a/src/Verify/GlobalUsings.cs b/src/Verify/GlobalUsings.cs index 9f1d416d2d..11ca693971 100644 --- a/src/Verify/GlobalUsings.cs +++ b/src/Verify/GlobalUsings.cs @@ -1,6 +1,7 @@ // Global using directives global using System.Diagnostics.Contracts; +global using System.IO.Hashing; global using VerifyTests; global using Argon; global using DiffEngine; diff --git a/src/Verify/Naming/FileNameBuilder.cs b/src/Verify/Naming/FileNameBuilder.cs index 7500dfc2c1..8161b26c82 100644 --- a/src/Verify/Naming/FileNameBuilder.cs +++ b/src/Verify/Naming/FileNameBuilder.cs @@ -1,8 +1,4 @@ -#if NET6_0_OR_GREATER || NETFRAMEWORK -using System.IO.Hashing; -#endif - -static class FileNameBuilder +static class FileNameBuilder { public static FrameworkNameVersion? FrameworkName(this Assembly assembly) { @@ -54,17 +50,15 @@ public static string GetParameterText(IReadOnlyList? methodParameters, V builder.Length -= 1; var parameterText = builder.ToString(); -#if NET6_0_OR_GREATER || NETFRAMEWORK if (settings.hashParameters) { var hashed = HashString(parameterText); return $"_{hashed}"; } -#endif + return parameterText; } -#if NET6_0_OR_GREATER || NETFRAMEWORK static string HashString(string value) { var data = XxHash64.Hash(Encoding.UTF8.GetBytes(value)); @@ -78,5 +72,4 @@ static string HashString(string value) return builder.ToString(); } -#endif } \ No newline at end of file diff --git a/src/Verify/Naming/ParameterSettings.cs b/src/Verify/Naming/ParameterSettings.cs index 70aee518aa..8352bf3a31 100644 --- a/src/Verify/Naming/ParameterSettings.cs +++ b/src/Verify/Naming/ParameterSettings.cs @@ -70,7 +70,6 @@ public void IgnoreParametersForVerified(params object?[] parameters) ignoreParametersForVerified = true; } -#if NET6_0_OR_GREATER || NETFRAMEWORK internal bool hashParameters; /// @@ -94,5 +93,4 @@ public void UseHashedParameters(params object?[] parameters) UseParameters(parameters); HashParameters(); } -#endif } \ No newline at end of file diff --git a/src/Verify/SettingsTask.cs b/src/Verify/SettingsTask.cs index 0367ad9fa4..84583dccd1 100644 --- a/src/Verify/SettingsTask.cs +++ b/src/Verify/SettingsTask.cs @@ -271,7 +271,6 @@ public SettingsTask UniqueForRuntimeAndVersion() return this; } -#if NET6_0_OR_GREATER || NETFRAMEWORK /// /// Provide parameters to hash together and pass to . /// Used to get a deterministic file name while avoiding long paths. @@ -295,8 +294,6 @@ public SettingsTask HashParameters() return this; } -#endif - /// /// Use the current processor architecture (x86/x64/arm/arm64) to make the test results unique. /// Used when a test produces different results based on processor architecture. diff --git a/src/Verify/VerifySettings.cs b/src/Verify/VerifySettings.cs index f7d79d0a66..8d00239cc3 100644 --- a/src/Verify/VerifySettings.cs +++ b/src/Verify/VerifySettings.cs @@ -25,11 +25,7 @@ public VerifySettings(VerifySettings? settings) streamComparer = settings.streamComparer; parameters = settings.parameters; ignoreParametersForVerified = settings.ignoreParametersForVerified; - -#if NET6_0_OR_GREATER || NETFRAMEWORK hashParameters = settings.hashParameters; -#endif - parametersText = settings.parametersText; fileName = settings.fileName; UniquePrefixDisabled = settings.UniquePrefixDisabled;