Skip to content

Commit

Permalink
Use on/off for stop on fail banner display
Browse files Browse the repository at this point in the history
  • Loading branch information
bradwilson committed Nov 12, 2023
1 parent 64d2a15 commit 4e99b52
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,13 @@ protected override bool Visit(ITestAssemblyExecutionStarting executionStarting)
if (executionStarting.ExecutionOptions.GetDiagnosticMessagesOrDefault())
{
var threadCount = executionStarting.ExecutionOptions.GetMaxParallelThreadsOrDefault();
var stopOnFail = executionStarting.ExecutionOptions.GetStopOnTestFailOrDefault().ToString().ToLowerInvariant();

Logger.LogImportantMessage(
" Starting: {0} (parallel test collections = {1}, max threads = {2}, stop on fail = {3})",
assemblyDisplayName,
!executionStarting.ExecutionOptions.GetDisableParallelizationOrDefault() ? "on" : "off",
threadCount < 0 ? "unlimited" : threadCount.ToString(CultureInfo.CurrentCulture),
stopOnFail
executionStarting.ExecutionOptions.GetStopOnTestFailOrDefault() ? "on" : "off"
);
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,13 @@ protected virtual void HandleTestAssemblyExecutionStarting(MessageHandlerArgs<IT
if (executionStarting.ExecutionOptions.GetDiagnosticMessagesOrDefault())
{
var threadCount = executionStarting.ExecutionOptions.GetMaxParallelThreadsOrDefault();
var stopOnFail = executionStarting.ExecutionOptions.GetStopOnTestFailOrDefault().ToString().ToLowerInvariant();

Logger.LogImportantMessage(
" Starting: {0} (parallel test collections = {1}, max threads = {2}, stop on fail = {3})",
assemblyDisplayName,
!executionStarting.ExecutionOptions.GetDisableParallelizationOrDefault() ? "on" : "off",
threadCount < 0 ? "unlimited" : threadCount.ToString(CultureInfo.CurrentCulture),
stopOnFail
executionStarting.ExecutionOptions.GetStopOnTestFailOrDefault() ? "on" : "off"
);
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public class OnMessage_ITestAssemblyExecutionStarting
{
[Theory]
[InlineData(false, "[Imp] => Starting: testAssembly")]
[InlineData(true, "[Imp] => Starting: testAssembly (parallel test collections = on, max threads = 42, stop on fail = true)")]
[InlineData(true, "[Imp] => Starting: testAssembly (parallel test collections = on, max threads = 42, stop on fail = on)")]
public static void LogsMessage(bool diagnosticMessages, string expectedResult)
{
var message = Mocks.TestAssemblyExecutionStarting(diagnosticMessages: diagnosticMessages);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public class OnMessage_ITestAssemblyExecutionStarting
{
[Theory]
[InlineData(false, "[Imp] => Starting: testAssembly")]
[InlineData(true, "[Imp] => Starting: testAssembly (parallel test collections = on, max threads = 42, stop on fail = true)")]
[InlineData(true, "[Imp] => Starting: testAssembly (parallel test collections = on, max threads = 42, stop on fail = on)")]
public static void LogsMessage(bool diagnosticMessages, string expectedResult)
{
var message = Mocks.TestAssemblyExecutionStarting(diagnosticMessages: diagnosticMessages);
Expand Down

0 comments on commit 4e99b52

Please sign in to comment.