Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/vstest.console/Internal/ConsoleLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ private void TestResultHandler(object sender, TestResultEventArgs e)
{
var output = string.Format(CultureInfo.CurrentCulture, CommandLineResources.PassedTestIndicator, name);
Output.Information(output);
DisplayFullInformation(e.Result);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Print DebugTraceCategory in DisplayFullInformation()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in next commit

}
this.testsPassed++;
}
Expand Down
26 changes: 26 additions & 0 deletions test/vstest.console.UnitTests/Internal/ConsoleLoggerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,32 @@ public void TestResultHandlerShouldWriteToConsoleShouldShowPassedTestsForNormalV
this.mockOutput.Verify(o => o.WriteLine(string.Format(CultureInfo.CurrentCulture, CommandLineResources.NotRunTestIndicator, "TestName"), OutputLevel.Information), Times.Exactly(2));
}

[TestMethod]
public void TestResultHandlerShouldShowStdOutMsgOfPassedTestIfVerbosityIsNormal()
{
var parameters = new Dictionary<string, string>();
parameters.Add("verbosity", "normal");
this.consoleLogger.Initialize(this.events.Object, parameters);

var testcase = new TestCase("TestName", new Uri("some://uri"), "TestSource");

string message = "Dummy message";
TestResultMessage testResultMessage = new TestResultMessage(TestResultMessage.AdditionalInfoCategory, message);

var testresult = new ObjectModel.TestResult(testcase);
testresult.Outcome = TestOutcome.Passed;
testresult.Messages.Add(testResultMessage);

var eventArgs = new TestRunChangedEventArgs(null, new List<ObjectModel.TestResult> { testresult }, null);

// Raise an event on mock object
this.testRunRequest.Raise(m => m.OnRunStatsChange += null, eventArgs);
this.FlushLoggerMessages();

this.mockOutput.Verify(o => o.WriteLine(CommandLineResources.AddnlInfoMessagesBanner, OutputLevel.Information), Times.Once());
this.mockOutput.Verify(o => o.WriteLine(" " + message, OutputLevel.Information), Times.Once());
}

[TestMethod]
public void TestResultHandlerShouldWriteToConsoleButSkipPassedTestsForMinimalVerbosity()
{
Expand Down