** Attachment added: "NUnitConsole.cs"
   
https://bugs.launchpad.net/nunitv2/+bug/797150/+attachment/2168287/+files/NUnitConsole.cs

-- 
You received this bug notification because you are a member of NUnit
Developers, which is subscribed to NUnit V2.
https://bugs.launchpad.net/bugs/797150

Title:
  Console.Clear(); throw System.IO.Exception

Status in NUnit V2 Test Framework:
  New

Bug description:
  When testing a console application and run the method Console.Clear(); 
NUnit's console generates the exception System.IO.Exception.  This work at 
MonoDevelop Test Console and don't work at NUnit Console and Resharper Console.
  Code Example:

  using System;
  using System.IO;
  using NUnit.Framework;

  namespace NUnitConsoleBug
  {
      [TestFixture]
      public class NUnitConsole
      {
          [Test]
          public void TestConsoleWriteLine()
          {
              //This work!
              var sw = new StringWriter();
              Console.SetOut(sw);
              Console.WriteLine("Test WriteLine{0}", Environment.NewLine);
              Assert.IsTrue(sw.ToString().Contains(string.Format("Test 
WriteLine{0}", Environment.NewLine)));
              sw.Dispose();
          }

          [Test]
          public void TestConsoleClear()
          {
              //This dont work!
              var sw = new StringWriter();
              Console.SetOut(sw);
              Assert.DoesNotThrow(Console.Clear);
              sw.Dispose();
          }
      }
  }

To manage notifications about this bug go to:
https://bugs.launchpad.net/nunitv2/+bug/797150/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~nunit-core
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~nunit-core
More help   : https://help.launchpad.net/ListHelp

Reply via email to