From 15571b693c656e850cd6760e7546a7eb12494cf3 Mon Sep 17 00:00:00 2001 From: edleno2 Date: Thu, 13 May 2021 20:30:54 -0700 Subject: [PATCH] Use Console.WriteLine for messages Prior to these were using Debug.WriteLine which does not work in a release build. Using Console.WriteLine allows the TestLauncher to be built in Release mode when uploaded to Nuget. Fix #738 --- source/UnitTestLauncher/Program.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/UnitTestLauncher/Program.cs b/source/UnitTestLauncher/Program.cs index ba2157d..8560c5c 100644 --- a/source/UnitTestLauncher/Program.cs +++ b/source/UnitTestLauncher/Program.cs @@ -75,13 +75,13 @@ private static bool RunTest( method.Invoke(null, null); totalTicks = DateTime.UtcNow.Ticks - dt; - Debug.WriteLine($"Test passed: {method.Name}, {totalTicks}"); + Console.WriteLine($"Test passed: {method.Name}, {totalTicks}"); } catch (Exception ex) { if (ex.GetType() == typeof(SkipTestException)) { - Debug.WriteLine($"Test skipped: {method.Name}, {ex.Message}"); + Console.WriteLine($"Test skipped: {method.Name}, {ex.Message}"); if (isSetupMethod) { // In case the Setup attribute test is skipped, we will skip @@ -91,7 +91,7 @@ private static bool RunTest( } else { - Debug.WriteLine($"Test failed: {method.Name}, {ex.Message}"); + Console.WriteLine($"Test failed: {method.Name}, {ex.Message}"); } }