From 7d4539ca9ca315a4f0d29198584e2cd130df2cac Mon Sep 17 00:00:00 2001 From: Tim Murphy Date: Sat, 6 Dec 2025 05:07:16 +1100 Subject: [PATCH 1/3] Remove two build messages Refactored the `TestFormatter` class to use inline constructor syntax, simplifying the code by removing the separate constructor definition. Updated the `ConsumedMessages` property to use the shorthand `[]` for initializing an empty list, improving code readability and conciseness. --- .../Reqnroll.RuntimeTests/Formatters/FormatterBaseTests.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Tests/Reqnroll.RuntimeTests/Formatters/FormatterBaseTests.cs b/Tests/Reqnroll.RuntimeTests/Formatters/FormatterBaseTests.cs index 9306179c2..746fe3c70 100644 --- a/Tests/Reqnroll.RuntimeTests/Formatters/FormatterBaseTests.cs +++ b/Tests/Reqnroll.RuntimeTests/Formatters/FormatterBaseTests.cs @@ -17,21 +17,18 @@ namespace Reqnroll.RuntimeTests.Formatters; public class FormatterBaseTests { - private class TestFormatter : FormatterBase + private class TestFormatter(IFormattersConfigurationProvider config, IFormatterLog logger, string name) : FormatterBase(config, logger, name) { public bool LaunchInnerCalled = false; public IDictionary LaunchInnerConfig = null!; public Action LaunchInnerCallback = null!; public bool ConsumeAndFormatMessagesCalled = false; public CancellationToken? ConsumedToken; - public List ConsumedMessages = new(); + public List ConsumedMessages = []; public bool ReportInitializedCalled = false; public bool CloseAsyncCalled = false; public bool CompleteWriterOnLaunchInner = false; - public TestFormatter(IFormattersConfigurationProvider config, IFormatterLog logger, string name) - : base(config, logger, name) { } - public override void LaunchInner(IDictionary formatterConfig, Action onAfterInitialization) { LaunchInnerCalled = true; From 82e46f7a4850d302ba2c477eb0960db67ee70754 Mon Sep 17 00:00:00 2001 From: Tim Murphy Date: Sat, 6 Dec 2025 16:21:03 +1100 Subject: [PATCH 2/3] Improve debugging Updated the `RuntimePluginLocatorTests` to explicitly order the `foundPlugins` collection alphabetically using `.OrderBy(p => p)`. Reordered the expected plugin list to match the new ordering logic. These changes improve debugging if the test fails. --- Tests/Reqnroll.PluginTests/RuntimePluginLocatorTests.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/Reqnroll.PluginTests/RuntimePluginLocatorTests.cs b/Tests/Reqnroll.PluginTests/RuntimePluginLocatorTests.cs index cfc8c1c72..86e4ee7ec 100644 --- a/Tests/Reqnroll.PluginTests/RuntimePluginLocatorTests.cs +++ b/Tests/Reqnroll.PluginTests/RuntimePluginLocatorTests.cs @@ -48,15 +48,15 @@ public void LoadPlugins_Find_All_Referenced_Plugins() var allProjectReferenceFoundByPluginLocator = projectReferences.All(pr => plugins.Any(plugin => plugin.Contains(pr))); allProjectReferenceFoundByPluginLocator.Should().BeTrue(); - var foundPlugins = plugins.Select(Path.GetFileName); + var foundPlugins = plugins.Select(Path.GetFileName).OrderBy(p => p); foundPlugins.Should().BeEquivalentTo([ - "Reqnroll.PluginTests.dll", // This test assembly - "Reqnroll.Microsoft.Extensions.DependencyInjection.ReqnrollPlugin.dll", "Reqnroll.Autofac.ReqnrollPlugin.dll", "Reqnroll.ExternalData.ReqnrollPlugin.dll", - "Reqnroll.Windsor.ReqnrollPlugin.dll", + "Reqnroll.Microsoft.Extensions.DependencyInjection.ReqnrollPlugin.dll", "Reqnroll.MSTest.ReqnrollPlugin.dll", "Reqnroll.NUnit.ReqnrollPlugin.dll", + "Reqnroll.PluginTests.dll", // This test assembly + "Reqnroll.Windsor.ReqnrollPlugin.dll", "Reqnroll.xUnit.ReqnrollPlugin.dll", "Reqnroll.xUnit.Generator.ReqnrollPlugin.dll", ]); From 26071f8b4cbe6a7beae2300f3827f2ac6ed61a78 Mon Sep 17 00:00:00 2001 From: Tim Murphy Date: Sat, 6 Dec 2025 16:25:11 +1100 Subject: [PATCH 3/3] Update plugin list in RuntimePluginLocatorTests Updated the list of expected plugin DLLs in the `RuntimePluginLocatorTests` test file to include new generator-related plugins: - Added `Reqnroll.MSTest.Generator.ReqnrollPlugin.dll` - Added `Reqnroll.NUnit.Generator.ReqnrollPlugin.dll` These changes reflect the introduction of generator plugins and ensure the test expectations align with the updated plugin structure. --- Tests/Reqnroll.PluginTests/RuntimePluginLocatorTests.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Tests/Reqnroll.PluginTests/RuntimePluginLocatorTests.cs b/Tests/Reqnroll.PluginTests/RuntimePluginLocatorTests.cs index 86e4ee7ec..60f67f0d9 100644 --- a/Tests/Reqnroll.PluginTests/RuntimePluginLocatorTests.cs +++ b/Tests/Reqnroll.PluginTests/RuntimePluginLocatorTests.cs @@ -53,8 +53,10 @@ public void LoadPlugins_Find_All_Referenced_Plugins() "Reqnroll.Autofac.ReqnrollPlugin.dll", "Reqnroll.ExternalData.ReqnrollPlugin.dll", "Reqnroll.Microsoft.Extensions.DependencyInjection.ReqnrollPlugin.dll", - "Reqnroll.MSTest.ReqnrollPlugin.dll", - "Reqnroll.NUnit.ReqnrollPlugin.dll", + "Reqnroll.MSTest.Generator.ReqnrollPlugin.dll", + "Reqnroll.MSTest.ReqnrollPlugin.dll", + "Reqnroll.NUnit.Generator.ReqnrollPlugin.dll", + "Reqnroll.NUnit.ReqnrollPlugin.dll", "Reqnroll.PluginTests.dll", // This test assembly "Reqnroll.Windsor.ReqnrollPlugin.dll", "Reqnroll.xUnit.ReqnrollPlugin.dll",