public void writesHello() { MemoryStream stream = new MemoryStream(); StreamWriter streamWriter = new StreamWriter(stream); IOConsoleOut consoleOut = new EchoConsoleOut(streamWriter); consoleOut.Write("hello"); stream.Position = 0; StreamReader sr = new StreamReader(stream); Assert.AreEqual("hello", sr.ReadLine()); }
public static void Main(string[] args) { IOConsoleIn input = new EchoConsoleIn(Console.In); IOConsoleOut output = new EchoConsoleOut(Console.Out); new EchoServer(input, output).Start(); }