Skip to content

Commit

Permalink
Targets #421 - WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
alelom authored and Fraser Greenroyd committed Mar 8, 2023
1 parent a86c25b commit 347751b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions NUnit_Engine/NUnitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,19 @@ public void LoadReferencedAssemblies()
[TearDown]
public void LogRecordedEvents()
{
// This should check whether the test passed or not before dispatching to Warn/TextContext.

var events = BH.Engine.Base.Query.CurrentEvents();
if (events.Any())
{
foreach (var ev in events)
{
if (ev.Type == oM.Base.Debugging.EventType.Warning || ev.Type == oM.Base.Debugging.EventType.Error)
Assert.Warn($"{ev.Type}: {ev.Message}");
if (TestContext.CurrentContext.Result.Outcome.Status == NUnitTestStatus.Failed)
{
Assert.Warn($"Recorded {ev.Type}: {ev.Message}");
}
else
TestContext.Out.Write($"{ev.Type}: {ev.Message}");
{
TestContext.Out.Write($"{ev.Message}");
}
}
}

Expand Down

0 comments on commit 347751b

Please sign in to comment.