I am a newbie to unit testing. How do I check the for console output? I have
namespace XXShapes
{
public abstract class XXShape
{
public virtual void DrawXXShape()
{
Console.WriteLine("The XXShape was drawn.");
}
}
public class XXCircle : XXShape
{
public override void DrawXXShape()
{
Console.WriteLine("The XXCircle was drawn.");
}
}
}
namespace XXShapes.Test
{
[TestFixture]
public class XXShapeTest
{
[Test]
public void MyFirstTest()
{
XXShape s = new XXCircle();
string expected = "The XXCircle was drawn.";
s.DrawXXShape();
string actual = Console.ReadLine();
Assert.AreEqual(expected, actual);
}
}
}
How should I correctly be testing this? Thanks for any pointers. Cheers, ~ck