Reputation: 23187
Assert.True(1==1, "blah");
When this code runs, "blah" does not appear in the NUnit GUI. What additional steps need to be taken for me to see "blah" in the "Text Output" tab of NUnit?
Upvotes: 3
Views: 4671
Reputation: 1376
Simply use Console.WriteLine("yourtext")
to display any text in the TextOutput tab.
This has the added benefit (as opposed to the other answers) of not to mess with your test results, which is most propably what you want.
Upvotes: 1
Reputation: 754813
The message doesn't appear because the assert is valid. The Assert.True
method checks to see if the expression is true and displays the message only if it's false
. In this case 1==1
is true
hence it's not going to show.
Upvotes: 5