From cfa50b664ac0b02eeb883d7bf547a04a2c36ad85 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Sat, 4 Apr 2026 17:38:17 +0100 Subject: [PATCH 1/3] fix: scrub snapshot versions to 99.99.99 to avoid false Dependabot alerts The template snapshot test scrubber was replacing package versions with 1.0.0, which triggered Dependabot security alerts for packages with vulnerabilities fixed above 1.0.0 (e.g. OpenTelemetry.Instrumentation). Using 99.99.99 instead ensures scrubbed versions are always above any patched version threshold while still stabilizing snapshots. --- .../TUnit.AspNet/TUnit.AspNet/TUnit.AspNet.csproj | 4 ++-- .../TUnit.AspNet/WebApp/WebApp.csproj | 2 +- .../TUnit.Aspire.Starter.ApiService.csproj | 2 +- .../TUnit.Aspire.Starter.AppHost.csproj | 6 +++--- .../TUnit.Aspire.Starter.ServiceDefaults.csproj | 14 +++++++------- .../TUnit.Aspire.Starter.TestProject.csproj | 2 +- .../TUnit.Aspire.Starter.WebApp.csproj | 2 +- .../TUnit.Aspire.Test/TUnit.Aspire.Test.csproj | 2 +- .../TUnit.Playwright/TUnit.Playwright.csproj | 2 +- .../TUnit/TUnit.csproj | 2 +- .../TUnit.AspNet.FSharp/TUnit.AspNet.FSharp.fsproj | 6 +++--- .../TUnit.FSharp/TUnit.FSharp.fsproj | 6 +++--- .../TUnit.VB/TUnit.VB.vbproj | 2 +- TUnit.Templates.Tests/TemplateTestBase.cs | 2 +- 14 files changed, 27 insertions(+), 27 deletions(-) diff --git a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.AspNet._.verified/TUnit.AspNet/TUnit.AspNet/TUnit.AspNet.csproj b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.AspNet._.verified/TUnit.AspNet/TUnit.AspNet/TUnit.AspNet.csproj index eb10888b9e..ada0ba4558 100644 --- a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.AspNet._.verified/TUnit.AspNet/TUnit.AspNet/TUnit.AspNet.csproj +++ b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.AspNet._.verified/TUnit.AspNet/TUnit.AspNet/TUnit.AspNet.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.AspNet._.verified/TUnit.AspNet/WebApp/WebApp.csproj b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.AspNet._.verified/TUnit.AspNet/WebApp/WebApp.csproj index a6a96dcf18..4e760f00ab 100644 --- a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.AspNet._.verified/TUnit.AspNet/WebApp/WebApp.csproj +++ b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.AspNet._.verified/TUnit.AspNet/WebApp/WebApp.csproj @@ -7,7 +7,7 @@ - + diff --git a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.ApiService/TUnit.Aspire.Starter.ApiService.csproj b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.ApiService/TUnit.Aspire.Starter.ApiService.csproj index 1ad71b0e28..1e7a29b279 100644 --- a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.ApiService/TUnit.Aspire.Starter.ApiService.csproj +++ b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.ApiService/TUnit.Aspire.Starter.ApiService.csproj @@ -11,7 +11,7 @@ - + diff --git a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.AppHost/TUnit.Aspire.Starter.AppHost.csproj b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.AppHost/TUnit.Aspire.Starter.AppHost.csproj index 3cbe117a5a..a23dc38c69 100644 --- a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.AppHost/TUnit.Aspire.Starter.AppHost.csproj +++ b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.AppHost/TUnit.Aspire.Starter.AppHost.csproj @@ -1,6 +1,6 @@  - + Exe @@ -12,8 +12,8 @@ - - + + diff --git a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.ServiceDefaults/TUnit.Aspire.Starter.ServiceDefaults.csproj b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.ServiceDefaults/TUnit.Aspire.Starter.ServiceDefaults.csproj index f0593381b8..dccffa8b8e 100644 --- a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.ServiceDefaults/TUnit.Aspire.Starter.ServiceDefaults.csproj +++ b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.ServiceDefaults/TUnit.Aspire.Starter.ServiceDefaults.csproj @@ -10,13 +10,13 @@ - - - - - - - + + + + + + + diff --git a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.TestProject/TUnit.Aspire.Starter.TestProject.csproj b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.TestProject/TUnit.Aspire.Starter.TestProject.csproj index 026d0c8dd8..47c087a6c0 100644 --- a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.TestProject/TUnit.Aspire.Starter.TestProject.csproj +++ b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.TestProject/TUnit.Aspire.Starter.TestProject.csproj @@ -9,7 +9,7 @@ - + diff --git a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.WebApp/TUnit.Aspire.Starter.WebApp.csproj b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.WebApp/TUnit.Aspire.Starter.WebApp.csproj index d871db6526..f7f28f8c00 100644 --- a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.WebApp/TUnit.Aspire.Starter.WebApp.csproj +++ b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.WebApp/TUnit.Aspire.Starter.WebApp.csproj @@ -7,7 +7,7 @@ - + diff --git a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Test._.verified/TUnit.Aspire.Test/TUnit.Aspire.Test.csproj b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Test._.verified/TUnit.Aspire.Test/TUnit.Aspire.Test.csproj index 40f4a6931d..a3f7553928 100644 --- a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Test._.verified/TUnit.Aspire.Test/TUnit.Aspire.Test.csproj +++ b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Test._.verified/TUnit.Aspire.Test/TUnit.Aspire.Test.csproj @@ -9,7 +9,7 @@ - + diff --git a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Playwright._.verified/TUnit.Playwright/TUnit.Playwright.csproj b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Playwright._.verified/TUnit.Playwright/TUnit.Playwright.csproj index f38c961198..1bf0e7bbbb 100644 --- a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Playwright._.verified/TUnit.Playwright/TUnit.Playwright.csproj +++ b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Playwright._.verified/TUnit.Playwright/TUnit.Playwright.csproj @@ -8,7 +8,7 @@ - + diff --git a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit._.verified/TUnit/TUnit.csproj b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit._.verified/TUnit/TUnit.csproj index cd7e07380b..0aa88ff6c1 100644 --- a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit._.verified/TUnit/TUnit.csproj +++ b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit._.verified/TUnit/TUnit.csproj @@ -8,7 +8,7 @@ - + diff --git a/TUnit.Templates.Tests/Snapshots/InstantiationTestWithFSharp.TUnit.AspNet.FSharp._.verified/TUnit.AspNet.FSharp/TUnit.AspNet.FSharp/TUnit.AspNet.FSharp.fsproj b/TUnit.Templates.Tests/Snapshots/InstantiationTestWithFSharp.TUnit.AspNet.FSharp._.verified/TUnit.AspNet.FSharp/TUnit.AspNet.FSharp/TUnit.AspNet.FSharp.fsproj index 30cbfc590b..5f0fd47ed0 100644 --- a/TUnit.Templates.Tests/Snapshots/InstantiationTestWithFSharp.TUnit.AspNet.FSharp._.verified/TUnit.AspNet.FSharp/TUnit.AspNet.FSharp/TUnit.AspNet.FSharp.fsproj +++ b/TUnit.Templates.Tests/Snapshots/InstantiationTestWithFSharp.TUnit.AspNet.FSharp._.verified/TUnit.AspNet.FSharp/TUnit.AspNet.FSharp/TUnit.AspNet.FSharp.fsproj @@ -9,9 +9,9 @@ - - - + + + diff --git a/TUnit.Templates.Tests/Snapshots/InstantiationTestWithFSharp.TUnit.FSharp._.verified/TUnit.FSharp/TUnit.FSharp.fsproj b/TUnit.Templates.Tests/Snapshots/InstantiationTestWithFSharp.TUnit.FSharp._.verified/TUnit.FSharp/TUnit.FSharp.fsproj index fdc08116c8..9e7524bb60 100644 --- a/TUnit.Templates.Tests/Snapshots/InstantiationTestWithFSharp.TUnit.FSharp._.verified/TUnit.FSharp/TUnit.FSharp.fsproj +++ b/TUnit.Templates.Tests/Snapshots/InstantiationTestWithFSharp.TUnit.FSharp._.verified/TUnit.FSharp/TUnit.FSharp.fsproj @@ -9,9 +9,9 @@ - - - + + + diff --git a/TUnit.Templates.Tests/Snapshots/InstantiationTestWithVB.TUnit.VB._.verified/TUnit.VB/TUnit.VB.vbproj b/TUnit.Templates.Tests/Snapshots/InstantiationTestWithVB.TUnit.VB._.verified/TUnit.VB/TUnit.VB.vbproj index e319c608bf..0e1c14208b 100644 --- a/TUnit.Templates.Tests/Snapshots/InstantiationTestWithVB.TUnit.VB._.verified/TUnit.VB/TUnit.VB.vbproj +++ b/TUnit.Templates.Tests/Snapshots/InstantiationTestWithVB.TUnit.VB._.verified/TUnit.VB/TUnit.VB.vbproj @@ -8,6 +8,6 @@ - + diff --git a/TUnit.Templates.Tests/TemplateTestBase.cs b/TUnit.Templates.Tests/TemplateTestBase.cs index 2a6563a47f..d12cb853c3 100644 --- a/TUnit.Templates.Tests/TemplateTestBase.cs +++ b/TUnit.Templates.Tests/TemplateTestBase.cs @@ -41,7 +41,7 @@ private static void ScrubVersions(StringBuilder sb) foreach (var match in matches.Where(m => m.Success)) { - var line = match.Groups[0].Value.Replace(match.Groups[1].Value, "1.0.0"); + var line = match.Groups[0].Value.Replace(match.Groups[1].Value, "99.99.99"); sb.Replace(match.Value, line); } } From 9096cb0371daafc0add8167dfbfaf120b850f194 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Sat, 4 Apr 2026 18:02:03 +0100 Subject: [PATCH 2/3] refactor: use 0.0.0-scrubbed as sentinel version in snapshot scrubber Pre-release label makes the version structurally outside Dependabot's scan range and self-documenting, rather than relying on 99.99.99 being above all patched versions. --- .../TUnit.AspNet/TUnit.AspNet/TUnit.AspNet.csproj | 4 ++-- .../TUnit.AspNet/WebApp/WebApp.csproj | 2 +- .../TUnit.Aspire.Starter.ApiService.csproj | 2 +- .../TUnit.Aspire.Starter.AppHost.csproj | 6 +++--- .../TUnit.Aspire.Starter.ServiceDefaults.csproj | 14 +++++++------- .../TUnit.Aspire.Starter.TestProject.csproj | 2 +- .../TUnit.Aspire.Starter.WebApp.csproj | 2 +- .../TUnit.Aspire.Test/TUnit.Aspire.Test.csproj | 2 +- .../TUnit.Playwright/TUnit.Playwright.csproj | 2 +- .../TUnit/TUnit.csproj | 2 +- .../TUnit.AspNet.FSharp/TUnit.AspNet.FSharp.fsproj | 6 +++--- .../TUnit.FSharp/TUnit.FSharp.fsproj | 6 +++--- .../TUnit.VB/TUnit.VB.vbproj | 2 +- TUnit.Templates.Tests/TemplateTestBase.cs | 2 +- 14 files changed, 27 insertions(+), 27 deletions(-) diff --git a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.AspNet._.verified/TUnit.AspNet/TUnit.AspNet/TUnit.AspNet.csproj b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.AspNet._.verified/TUnit.AspNet/TUnit.AspNet/TUnit.AspNet.csproj index ada0ba4558..effb43438b 100644 --- a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.AspNet._.verified/TUnit.AspNet/TUnit.AspNet/TUnit.AspNet.csproj +++ b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.AspNet._.verified/TUnit.AspNet/TUnit.AspNet/TUnit.AspNet.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.AspNet._.verified/TUnit.AspNet/WebApp/WebApp.csproj b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.AspNet._.verified/TUnit.AspNet/WebApp/WebApp.csproj index 4e760f00ab..b4b7a7c4b2 100644 --- a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.AspNet._.verified/TUnit.AspNet/WebApp/WebApp.csproj +++ b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.AspNet._.verified/TUnit.AspNet/WebApp/WebApp.csproj @@ -7,7 +7,7 @@ - + diff --git a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.ApiService/TUnit.Aspire.Starter.ApiService.csproj b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.ApiService/TUnit.Aspire.Starter.ApiService.csproj index 1e7a29b279..cdd748d48d 100644 --- a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.ApiService/TUnit.Aspire.Starter.ApiService.csproj +++ b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.ApiService/TUnit.Aspire.Starter.ApiService.csproj @@ -11,7 +11,7 @@ - + diff --git a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.AppHost/TUnit.Aspire.Starter.AppHost.csproj b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.AppHost/TUnit.Aspire.Starter.AppHost.csproj index a23dc38c69..8566366698 100644 --- a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.AppHost/TUnit.Aspire.Starter.AppHost.csproj +++ b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.AppHost/TUnit.Aspire.Starter.AppHost.csproj @@ -1,6 +1,6 @@  - + Exe @@ -12,8 +12,8 @@ - - + + diff --git a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.ServiceDefaults/TUnit.Aspire.Starter.ServiceDefaults.csproj b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.ServiceDefaults/TUnit.Aspire.Starter.ServiceDefaults.csproj index dccffa8b8e..471878b908 100644 --- a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.ServiceDefaults/TUnit.Aspire.Starter.ServiceDefaults.csproj +++ b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.ServiceDefaults/TUnit.Aspire.Starter.ServiceDefaults.csproj @@ -10,13 +10,13 @@ - - - - - - - + + + + + + + diff --git a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.TestProject/TUnit.Aspire.Starter.TestProject.csproj b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.TestProject/TUnit.Aspire.Starter.TestProject.csproj index 47c087a6c0..37b04fc8da 100644 --- a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.TestProject/TUnit.Aspire.Starter.TestProject.csproj +++ b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.TestProject/TUnit.Aspire.Starter.TestProject.csproj @@ -9,7 +9,7 @@ - + diff --git a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.WebApp/TUnit.Aspire.Starter.WebApp.csproj b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.WebApp/TUnit.Aspire.Starter.WebApp.csproj index f7f28f8c00..5a558a4c50 100644 --- a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.WebApp/TUnit.Aspire.Starter.WebApp.csproj +++ b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.WebApp/TUnit.Aspire.Starter.WebApp.csproj @@ -7,7 +7,7 @@ - + diff --git a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Test._.verified/TUnit.Aspire.Test/TUnit.Aspire.Test.csproj b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Test._.verified/TUnit.Aspire.Test/TUnit.Aspire.Test.csproj index a3f7553928..641653ac85 100644 --- a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Test._.verified/TUnit.Aspire.Test/TUnit.Aspire.Test.csproj +++ b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Test._.verified/TUnit.Aspire.Test/TUnit.Aspire.Test.csproj @@ -9,7 +9,7 @@ - + diff --git a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Playwright._.verified/TUnit.Playwright/TUnit.Playwright.csproj b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Playwright._.verified/TUnit.Playwright/TUnit.Playwright.csproj index 1bf0e7bbbb..bf57cf7f8d 100644 --- a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Playwright._.verified/TUnit.Playwright/TUnit.Playwright.csproj +++ b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Playwright._.verified/TUnit.Playwright/TUnit.Playwright.csproj @@ -8,7 +8,7 @@ - + diff --git a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit._.verified/TUnit/TUnit.csproj b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit._.verified/TUnit/TUnit.csproj index 0aa88ff6c1..cd133f8adb 100644 --- a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit._.verified/TUnit/TUnit.csproj +++ b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit._.verified/TUnit/TUnit.csproj @@ -8,7 +8,7 @@ - + diff --git a/TUnit.Templates.Tests/Snapshots/InstantiationTestWithFSharp.TUnit.AspNet.FSharp._.verified/TUnit.AspNet.FSharp/TUnit.AspNet.FSharp/TUnit.AspNet.FSharp.fsproj b/TUnit.Templates.Tests/Snapshots/InstantiationTestWithFSharp.TUnit.AspNet.FSharp._.verified/TUnit.AspNet.FSharp/TUnit.AspNet.FSharp/TUnit.AspNet.FSharp.fsproj index 5f0fd47ed0..370cd6983e 100644 --- a/TUnit.Templates.Tests/Snapshots/InstantiationTestWithFSharp.TUnit.AspNet.FSharp._.verified/TUnit.AspNet.FSharp/TUnit.AspNet.FSharp/TUnit.AspNet.FSharp.fsproj +++ b/TUnit.Templates.Tests/Snapshots/InstantiationTestWithFSharp.TUnit.AspNet.FSharp._.verified/TUnit.AspNet.FSharp/TUnit.AspNet.FSharp/TUnit.AspNet.FSharp.fsproj @@ -9,9 +9,9 @@ - - - + + + diff --git a/TUnit.Templates.Tests/Snapshots/InstantiationTestWithFSharp.TUnit.FSharp._.verified/TUnit.FSharp/TUnit.FSharp.fsproj b/TUnit.Templates.Tests/Snapshots/InstantiationTestWithFSharp.TUnit.FSharp._.verified/TUnit.FSharp/TUnit.FSharp.fsproj index 9e7524bb60..065aa1fff5 100644 --- a/TUnit.Templates.Tests/Snapshots/InstantiationTestWithFSharp.TUnit.FSharp._.verified/TUnit.FSharp/TUnit.FSharp.fsproj +++ b/TUnit.Templates.Tests/Snapshots/InstantiationTestWithFSharp.TUnit.FSharp._.verified/TUnit.FSharp/TUnit.FSharp.fsproj @@ -9,9 +9,9 @@ - - - + + + diff --git a/TUnit.Templates.Tests/Snapshots/InstantiationTestWithVB.TUnit.VB._.verified/TUnit.VB/TUnit.VB.vbproj b/TUnit.Templates.Tests/Snapshots/InstantiationTestWithVB.TUnit.VB._.verified/TUnit.VB/TUnit.VB.vbproj index 0e1c14208b..7a9e25e6a9 100644 --- a/TUnit.Templates.Tests/Snapshots/InstantiationTestWithVB.TUnit.VB._.verified/TUnit.VB/TUnit.VB.vbproj +++ b/TUnit.Templates.Tests/Snapshots/InstantiationTestWithVB.TUnit.VB._.verified/TUnit.VB/TUnit.VB.vbproj @@ -8,6 +8,6 @@ - + diff --git a/TUnit.Templates.Tests/TemplateTestBase.cs b/TUnit.Templates.Tests/TemplateTestBase.cs index d12cb853c3..5565432ce4 100644 --- a/TUnit.Templates.Tests/TemplateTestBase.cs +++ b/TUnit.Templates.Tests/TemplateTestBase.cs @@ -41,7 +41,7 @@ private static void ScrubVersions(StringBuilder sb) foreach (var match in matches.Where(m => m.Success)) { - var line = match.Groups[0].Value.Replace(match.Groups[1].Value, "99.99.99"); + var line = match.Groups[0].Value.Replace(match.Groups[1].Value, "0.0.0-scrubbed"); sb.Replace(match.Value, line); } } From 93e0f218b84bb82224a0c06a170a3c9ff5ff4550 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Sat, 4 Apr 2026 18:05:29 +0100 Subject: [PATCH 3/3] refactor: extract scrubbed version constant and remove redundant filter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Extract magic string to ScrubbedVersion constant - Remove redundant .Where(m => m.Success) — Matches() only returns successful matches --- TUnit.Templates.Tests/TemplateTestBase.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/TUnit.Templates.Tests/TemplateTestBase.cs b/TUnit.Templates.Tests/TemplateTestBase.cs index 5565432ce4..b55be5708b 100644 --- a/TUnit.Templates.Tests/TemplateTestBase.cs +++ b/TUnit.Templates.Tests/TemplateTestBase.cs @@ -34,14 +34,15 @@ public abstract partial class TemplateTestBase : IDisposable .AddScrubber(ScrubVersions, "vbproj") ); + private const string ScrubbedVersion = "0.0.0-scrubbed"; + private static void ScrubVersions(StringBuilder sb) { var original = sb.ToString(); - var matches = VersionRegex().Matches(original); - foreach (var match in matches.Where(m => m.Success)) + foreach (var match in VersionRegex().Matches(original).Cast()) { - var line = match.Groups[0].Value.Replace(match.Groups[1].Value, "0.0.0-scrubbed"); + var line = match.Value.Replace(match.Groups[1].Value, ScrubbedVersion); sb.Replace(match.Value, line); } }