From f2976b69eccc53d90b19b045b5a5d318b8375841 Mon Sep 17 00:00:00 2001 From: Adam Tornhill Date: Thu, 21 May 2026 10:06:18 +0200 Subject: [PATCH 1/2] Check for test runs in the args --- csharp-example.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/csharp-example.cs b/csharp-example.cs index f97b3be..54f4038 100644 --- a/csharp-example.cs +++ b/csharp-example.cs @@ -2,5 +2,9 @@ class TestClass { static void Main(string[] args) { + if (args.Length >= 2 && args[0] == "cli" && args[1] == "test-run") + { + System.Console.WriteLine("Running tests"); + } } } From 0f2b518c7e572cd44b63fb12750848991fc4cd6a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 21 May 2026 08:12:55 +0000 Subject: [PATCH 2/2] refactor(csharp-example): extract complex conditional into IsTestRunCommand helper --- csharp-example.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/csharp-example.cs b/csharp-example.cs index 54f4038..7d8e3dc 100644 --- a/csharp-example.cs +++ b/csharp-example.cs @@ -2,9 +2,14 @@ class TestClass { static void Main(string[] args) { - if (args.Length >= 2 && args[0] == "cli" && args[1] == "test-run") + if (IsTestRunCommand(args)) { System.Console.WriteLine("Running tests"); } } + + static bool IsTestRunCommand(string[] args) + { + return args.Length >= 2 && args[0] == "cli" && args[1] == "test-run"; + } }