Skip to content

Commit

Permalink
[Runners] Raise the start event before the tests executes. (#59)
Browse files Browse the repository at this point in the history
The OnTestStarted was being called in the HandleAfterTestStarting. That
means that the event might not be raised if there is an issue with the
test setup, making it hard to track. Moved the call to the
HandleBeforeTestStarting to notify the test is going to strat which will
execute before any issue occurs.

fixes: #54
  • Loading branch information
mandel-macaque authored Apr 22, 2020
1 parent aaf6220 commit 9d7c784
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ void HandleBeforeTestStarting(MessageHandlerArgs<IBeforeTestStarting> args)
if (args == null || args.Message == null)
return;

// notify that a method is starting
OnTestStarted(args.Message.Test.DisplayName);
OnDiagnostic($"'Before' method for test '{args.Message.Test.DisplayName}' starting");
}

Expand All @@ -471,8 +473,6 @@ void HandleAfterTestStarting(MessageHandlerArgs<IAfterTestStarting> args)
if (args == null || args.Message == null)
return;

// notify that a method is starting
OnTestStarted(args.Message.Test.DisplayName);
OnDiagnostic($"'After' method for test '{args.Message.Test.DisplayName}' starting");
}

Expand Down

0 comments on commit 9d7c784

Please sign in to comment.