0

I am using NUnit 2.6 and have the following test case:

[Test]
public void TestCase()
{
    ....test case code....

// Success
Console.WriteLine("---------------->Test Passed<----------------");
}

After the test case is executed, the results are exported to an XML file (/xml=C:\TestResult.xml). In the resulting XML file, the console text "-->Test Passed<--" is not saved. Is there a way to show the Console.WriteLines in the XML file?

Command line:

"nunit-console-x86.exe" "Test.dll" /xml=C:\TestResult.xml /Domain=None /noshadow
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
lerner1225
  • 862
  • 7
  • 25

1 Answers1

0

NUnit V2 does not save the output you write in the XML result at all. NUnit 3 adds an output element that contains the text written by each test.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Charlie
  • 12,928
  • 1
  • 27
  • 31
  • 1
    Just downloaded NUnit 3.0 and tested my code. The Output tag displays the Console.WriteLines. Guess no other way than to upgrade. Thank you. – lerner1225 Sep 23 '16 at 07:56