Console.Clear(); throw System.IO.Exception
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
NUnit V2 |
Invalid
|
Undecided
|
Unassigned |
Bug Description
When testing a console application and run the method Console.Clear(); NUnit's console generates the exception System.
Code Example:
using System;
using System.IO;
using NUnit.Framework;
namespace NUnitConsoleBug
{
[TestFixture]
public class NUnitConsole
{
[Test]
public void TestConsoleWrit
{
//This work!
var sw = new StringWriter();
}
[Test]
public void TestConsoleClear()
{
//This dont work!
var sw = new StringWriter();
}
}
}
description: | updated |
tags: | added: confirm |
Changed in nunitv2: | |
assignee: | nobody → Charlie Poole (charlie.poole) |
milestone: | none → 2.6.0 |
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()
{
}