Beispiel #1
0
        static void Main(string[] args)
        {
            ConsoleReader reader = new ConsoleReader();

            if (reader.CreateSession())
            {
                reader.ReadInput();
            }
        }
Beispiel #2
0
        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");
            }
        }