From 74640b4b3ede0ce38ec702452177d9532c3b34f3 Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Wed, 19 Aug 2026 14:10:38 -0400 Subject: [PATCH] Use Particular.Approvals for approvals --- src/Directory.Packages.props | 1 - ...s_and_routes_under_pinned_field_names.approved.txt | 1 + ...s_and_routes_under_pinned_field_names.verified.txt | 11 ----------- .../Auth/RouteManifestEntrySerializationTests.cs | 7 +++---- .../ServiceControl.Infrastructure.Tests.csproj | 2 +- 5 files changed, 5 insertions(+), 17 deletions(-) create mode 100644 src/ServiceControl.Infrastructure.Tests/ApprovalFiles/RouteManifestEntrySerializationTests.Response_wraps_roles_and_routes_under_pinned_field_names.approved.txt delete mode 100644 src/ServiceControl.Infrastructure.Tests/Auth/RouteManifestEntrySerializationTests.Response_wraps_roles_and_routes_under_pinned_field_names.verified.txt diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index a0447ff284..481daef495 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -95,7 +95,6 @@ - diff --git a/src/ServiceControl.Infrastructure.Tests/ApprovalFiles/RouteManifestEntrySerializationTests.Response_wraps_roles_and_routes_under_pinned_field_names.approved.txt b/src/ServiceControl.Infrastructure.Tests/ApprovalFiles/RouteManifestEntrySerializationTests.Response_wraps_roles_and_routes_under_pinned_field_names.approved.txt new file mode 100644 index 0000000000..92fd36a197 --- /dev/null +++ b/src/ServiceControl.Infrastructure.Tests/ApprovalFiles/RouteManifestEntrySerializationTests.Response_wraps_roles_and_routes_under_pinned_field_names.approved.txt @@ -0,0 +1 @@ +{"roles":["admin"],"routes":[{"method":"GET","url_template":"/api/errors"}]} \ No newline at end of file diff --git a/src/ServiceControl.Infrastructure.Tests/Auth/RouteManifestEntrySerializationTests.Response_wraps_roles_and_routes_under_pinned_field_names.verified.txt b/src/ServiceControl.Infrastructure.Tests/Auth/RouteManifestEntrySerializationTests.Response_wraps_roles_and_routes_under_pinned_field_names.verified.txt deleted file mode 100644 index ed2dd257ef..0000000000 --- a/src/ServiceControl.Infrastructure.Tests/Auth/RouteManifestEntrySerializationTests.Response_wraps_roles_and_routes_under_pinned_field_names.verified.txt +++ /dev/null @@ -1,11 +0,0 @@ -{ - roles: [ - admin - ], - routes: [ - { - method: GET, - url_template: /api/errors - } - ] -} \ No newline at end of file diff --git a/src/ServiceControl.Infrastructure.Tests/Auth/RouteManifestEntrySerializationTests.cs b/src/ServiceControl.Infrastructure.Tests/Auth/RouteManifestEntrySerializationTests.cs index 3d72610362..2c2efe9a11 100644 --- a/src/ServiceControl.Infrastructure.Tests/Auth/RouteManifestEntrySerializationTests.cs +++ b/src/ServiceControl.Infrastructure.Tests/Auth/RouteManifestEntrySerializationTests.cs @@ -2,10 +2,9 @@ namespace ServiceControl.Infrastructure.Tests.Auth; using System.Text.Json; -using System.Threading.Tasks; using NUnit.Framework; +using Particular.Approvals; using ServiceControl.Infrastructure.Auth; -using VerifyNUnit; [TestFixture] class RouteManifestEntrySerializationTests @@ -30,12 +29,12 @@ public void Emits_snake_case_field_names_even_under_a_camelCase_policy() // Same contract as above, but for the response wrapper: roles are reported once at the top level, // not duplicated onto every route entry. [Test] - public Task Response_wraps_roles_and_routes_under_pinned_field_names() + public void Response_wraps_roles_and_routes_under_pinned_field_names() { var json = JsonSerializer.Serialize( new MyRoutesResponse(["admin"], [new RouteManifestEntry("GET", "/api/errors")]), new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }); - return Verifier.VerifyJson(json); + Approver.Verify(json); } } diff --git a/src/ServiceControl.Infrastructure.Tests/ServiceControl.Infrastructure.Tests.csproj b/src/ServiceControl.Infrastructure.Tests/ServiceControl.Infrastructure.Tests.csproj index 5c53d4918f..147347f072 100644 --- a/src/ServiceControl.Infrastructure.Tests/ServiceControl.Infrastructure.Tests.csproj +++ b/src/ServiceControl.Infrastructure.Tests/ServiceControl.Infrastructure.Tests.csproj @@ -18,7 +18,7 @@ - + \ No newline at end of file