Results in a cleared screan with "Exiting..." displayed at the top.
Since Console.Clear() is being applied to the real console, the example test runs successfully under nunit-console, but causes an error under the nunit gui, which doesn't have a real console.
Continuing above comment...
By experimenting, I ascertained that Console.Clear() always applies to the real console, even when Console.SetOut has been called.
For example, in a console program, this code
public static void Main()
Console. WriteLine( "Starting. ..");
{
var savedOut = Console.Out;
Console. WriteLine( "Setting Console to StringWriter");
Console. SetOut( sw);
var sw = new StringWriter();
}
Results in a cleared screan with "Exiting..." displayed at the top.
Since Console.Clear() is being applied to the real console, the example test runs successfully under nunit-console, but causes an error under the nunit gui, which doesn't have a real console.
An interesting effect, but not an NUnit bug.
Charlie