From 40b5a10a0774db2b7e42339aa46785ecfd8afec3 Mon Sep 17 00:00:00 2001 From: skwasjer <11424653+skwasjer@users.noreply.github.com> Date: Wed, 2 Oct 2024 00:05:03 +0200 Subject: [PATCH] test: move verified files to dedicated folder to reduce clutter. Also fix missing namespace for shim and suppress S3236. --- .../.NET_6.0.verified.txt} | 0 .../.NET_8.0.verified.txt} | 0 .../.NET_Framework_4.6.2.verified.txt} | 0 .../.NET_Framework_4.7.2.verified.txt} | 0 .../.NET_Framework_4.8.verified.txt} | 0 .../.NET_Standard_2.1.verified.txt} | 0 .../.NET_6.0.verified.txt} | 0 .../.NET_8.0.verified.txt} | 0 .../.NET_Core_3.1.verified.txt} | 0 test/MockHttp.Testing/Specs/PublicApiSpec.cs | 9 +++++++-- .../.NET_6.0.verified.txt} | 0 .../.NET_8.0.verified.txt} | 0 .../.NET_Framework_4.6.2.verified.txt} | 0 .../.NET_Framework_4.7.2.verified.txt} | 0 .../.NET_Framework_4.8.verified.txt} | 0 .../.NET_Standard_2.1.verified.txt} | 0 16 files changed, 7 insertions(+), 2 deletions(-) rename test/MockHttp.Json.Tests/{PublicApiTests.Api_has_not_changed.NET_6.0.verified.txt => PublicApi/.NET_6.0.verified.txt} (100%) rename test/MockHttp.Json.Tests/{PublicApiTests.Api_has_not_changed.NET_8.0.verified.txt => PublicApi/.NET_8.0.verified.txt} (100%) rename test/MockHttp.Json.Tests/{PublicApiTests.Api_has_not_changed.NET_Framework_4.6.2.verified.txt => PublicApi/.NET_Framework_4.6.2.verified.txt} (100%) rename test/MockHttp.Json.Tests/{PublicApiTests.Api_has_not_changed.NET_Framework_4.7.2.verified.txt => PublicApi/.NET_Framework_4.7.2.verified.txt} (100%) rename test/MockHttp.Json.Tests/{PublicApiTests.Api_has_not_changed.NET_Framework_4.8.verified.txt => PublicApi/.NET_Framework_4.8.verified.txt} (100%) rename test/MockHttp.Json.Tests/{PublicApiTests.Api_has_not_changed.NET_Standard_2.1.verified.txt => PublicApi/.NET_Standard_2.1.verified.txt} (100%) rename test/MockHttp.Server.Tests/{PublicApiTests.Api_has_not_changed.NET_6.0.verified.txt => PublicApi/.NET_6.0.verified.txt} (100%) rename test/MockHttp.Server.Tests/{PublicApiTests.Api_has_not_changed.NET_8.0.verified.txt => PublicApi/.NET_8.0.verified.txt} (100%) rename test/MockHttp.Server.Tests/{PublicApiTests.Api_has_not_changed.NET_Core_3.1.verified.txt => PublicApi/.NET_Core_3.1.verified.txt} (100%) rename test/MockHttp.Tests/{PublicApiTests.Api_has_not_changed.NET_6.0.verified.txt => PublicApi/.NET_6.0.verified.txt} (100%) rename test/MockHttp.Tests/{PublicApiTests.Api_has_not_changed.NET_8.0.verified.txt => PublicApi/.NET_8.0.verified.txt} (100%) rename test/MockHttp.Tests/{PublicApiTests.Api_has_not_changed.NET_Framework_4.6.2.verified.txt => PublicApi/.NET_Framework_4.6.2.verified.txt} (100%) rename test/MockHttp.Tests/{PublicApiTests.Api_has_not_changed.NET_Framework_4.7.2.verified.txt => PublicApi/.NET_Framework_4.7.2.verified.txt} (100%) rename test/MockHttp.Tests/{PublicApiTests.Api_has_not_changed.NET_Framework_4.8.verified.txt => PublicApi/.NET_Framework_4.8.verified.txt} (100%) rename test/MockHttp.Tests/{PublicApiTests.Api_has_not_changed.NET_Standard_2.1.verified.txt => PublicApi/.NET_Standard_2.1.verified.txt} (100%) diff --git a/test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_6.0.verified.txt b/test/MockHttp.Json.Tests/PublicApi/.NET_6.0.verified.txt similarity index 100% rename from test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_6.0.verified.txt rename to test/MockHttp.Json.Tests/PublicApi/.NET_6.0.verified.txt diff --git a/test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_8.0.verified.txt b/test/MockHttp.Json.Tests/PublicApi/.NET_8.0.verified.txt similarity index 100% rename from test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_8.0.verified.txt rename to test/MockHttp.Json.Tests/PublicApi/.NET_8.0.verified.txt diff --git a/test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.6.2.verified.txt b/test/MockHttp.Json.Tests/PublicApi/.NET_Framework_4.6.2.verified.txt similarity index 100% rename from test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.6.2.verified.txt rename to test/MockHttp.Json.Tests/PublicApi/.NET_Framework_4.6.2.verified.txt diff --git a/test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.7.2.verified.txt b/test/MockHttp.Json.Tests/PublicApi/.NET_Framework_4.7.2.verified.txt similarity index 100% rename from test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.7.2.verified.txt rename to test/MockHttp.Json.Tests/PublicApi/.NET_Framework_4.7.2.verified.txt diff --git a/test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.8.verified.txt b/test/MockHttp.Json.Tests/PublicApi/.NET_Framework_4.8.verified.txt similarity index 100% rename from test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.8.verified.txt rename to test/MockHttp.Json.Tests/PublicApi/.NET_Framework_4.8.verified.txt diff --git a/test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_Standard_2.1.verified.txt b/test/MockHttp.Json.Tests/PublicApi/.NET_Standard_2.1.verified.txt similarity index 100% rename from test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_Standard_2.1.verified.txt rename to test/MockHttp.Json.Tests/PublicApi/.NET_Standard_2.1.verified.txt diff --git a/test/MockHttp.Server.Tests/PublicApiTests.Api_has_not_changed.NET_6.0.verified.txt b/test/MockHttp.Server.Tests/PublicApi/.NET_6.0.verified.txt similarity index 100% rename from test/MockHttp.Server.Tests/PublicApiTests.Api_has_not_changed.NET_6.0.verified.txt rename to test/MockHttp.Server.Tests/PublicApi/.NET_6.0.verified.txt diff --git a/test/MockHttp.Server.Tests/PublicApiTests.Api_has_not_changed.NET_8.0.verified.txt b/test/MockHttp.Server.Tests/PublicApi/.NET_8.0.verified.txt similarity index 100% rename from test/MockHttp.Server.Tests/PublicApiTests.Api_has_not_changed.NET_8.0.verified.txt rename to test/MockHttp.Server.Tests/PublicApi/.NET_8.0.verified.txt diff --git a/test/MockHttp.Server.Tests/PublicApiTests.Api_has_not_changed.NET_Core_3.1.verified.txt b/test/MockHttp.Server.Tests/PublicApi/.NET_Core_3.1.verified.txt similarity index 100% rename from test/MockHttp.Server.Tests/PublicApiTests.Api_has_not_changed.NET_Core_3.1.verified.txt rename to test/MockHttp.Server.Tests/PublicApi/.NET_Core_3.1.verified.txt diff --git a/test/MockHttp.Testing/Specs/PublicApiSpec.cs b/test/MockHttp.Testing/Specs/PublicApiSpec.cs index 1034db38..922c6250 100644 --- a/test/MockHttp.Testing/Specs/PublicApiSpec.cs +++ b/test/MockHttp.Testing/Specs/PublicApiSpec.cs @@ -42,18 +42,23 @@ public Task Api_has_not_changed() string targetFramework = sut.GetCustomAttribute()?.FrameworkDisplayName?.Replace(' ', '_') ?? throw new InvalidOperationException("Framework display name is required."); - settings.UseMethodName(nameof(Api_has_not_changed) + targetFramework); + settings.UseFileName(targetFramework); + settings.UseDirectory("PublicApi"); // Act string publicApi = sut.GeneratePublicApi(_options); // Assert // ReSharper disable once ExplicitCallerInfoArgument +#pragma warning disable S3236 return Verify(publicApi, settings, _sourceFile!); +#pragma warning restore S3236 } } #else -// Stub for unsupported frameworks +namespace MockHttp.Specs; + +// Empty shim for when verification is disabled. public abstract class PublicApiSpec { // ReSharper disable once UnusedParameter.Local diff --git a/test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_6.0.verified.txt b/test/MockHttp.Tests/PublicApi/.NET_6.0.verified.txt similarity index 100% rename from test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_6.0.verified.txt rename to test/MockHttp.Tests/PublicApi/.NET_6.0.verified.txt diff --git a/test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_8.0.verified.txt b/test/MockHttp.Tests/PublicApi/.NET_8.0.verified.txt similarity index 100% rename from test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_8.0.verified.txt rename to test/MockHttp.Tests/PublicApi/.NET_8.0.verified.txt diff --git a/test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.6.2.verified.txt b/test/MockHttp.Tests/PublicApi/.NET_Framework_4.6.2.verified.txt similarity index 100% rename from test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.6.2.verified.txt rename to test/MockHttp.Tests/PublicApi/.NET_Framework_4.6.2.verified.txt diff --git a/test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.7.2.verified.txt b/test/MockHttp.Tests/PublicApi/.NET_Framework_4.7.2.verified.txt similarity index 100% rename from test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.7.2.verified.txt rename to test/MockHttp.Tests/PublicApi/.NET_Framework_4.7.2.verified.txt diff --git a/test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.8.verified.txt b/test/MockHttp.Tests/PublicApi/.NET_Framework_4.8.verified.txt similarity index 100% rename from test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.8.verified.txt rename to test/MockHttp.Tests/PublicApi/.NET_Framework_4.8.verified.txt diff --git a/test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_Standard_2.1.verified.txt b/test/MockHttp.Tests/PublicApi/.NET_Standard_2.1.verified.txt similarity index 100% rename from test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_Standard_2.1.verified.txt rename to test/MockHttp.Tests/PublicApi/.NET_Standard_2.1.verified.txt