Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
OsirisTerje committed Apr 9, 2024
1 parent f98569d commit 6f5dc71
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/NUnitTestAdapterTests/NUnitEventListenerOutputTests.cs
Expand Up @@ -57,6 +57,17 @@ public void Setup()

[Test]
public void ThatNormalTestOutputIsOutput()
{
var sut = new NUnitEventListener(converter, executor);
sut.OnTestEvent(TestOutputOut);
sut.OnTestEvent(TestFinish);

recorder.Received().SendMessage(Arg.Any<TestMessageLevel>(), Arg.Is<string>(x => x.StartsWith("Whatever")));
converter.Received().GetVsTestResults(Arg.Any<NUnitTestEventTestCase>(), Arg.Is<ICollection<INUnitTestEventTestOutput>>(x => x.Count == 1));
}

[Test]
public void ThatProgressTestOutputIsOutput()
{
var sut = new NUnitEventListener(converter, executor);
sut.OnTestEvent(TestOutputProgress);
Expand All @@ -77,6 +88,19 @@ public void ThatNormalTestOutputIsError()
converter.Received().GetVsTestResults(Arg.Any<NUnitTestEventTestCase>(), Arg.Is<ICollection<INUnitTestEventTestOutput>>(x => x.Count == 1));
}

[Test]
public void ThatConsoleOutCanStopAllTestOutput()
{
settings.ConsoleOut.Returns(0);
var sut = new NUnitEventListener(converter, executor);
sut.OnTestEvent(TestOutputOut);
sut.OnTestEvent(TestOutputProgress);
sut.OnTestEvent(TestOutputError);
sut.OnTestEvent(TestFinish);

recorder.DidNotReceive().SendMessage(Arg.Any<TestMessageLevel>(), Arg.Any<string>());
}

[Test]
public void ThatTestOutputWithOnlyWhiteSpaceIsNotOutput()
{
Expand Down

0 comments on commit 6f5dc71

Please sign in to comment.