static void Main(string[] args) { ConsoleReader reader = new ConsoleReader(); if (reader.CreateSession()) { reader.ReadInput(); } }
public void TestReadInput() { IInputReader reader = new ConsoleReader(); string expected = "test"; using (StringReader sr = new StringReader(expected)) { Console.SetIn(sr); Assert.AreEqual(reader.ReadInput(), expected, "The read value should be the same as the input"); } }