示例#1
0
        public void TestMoreThanFiveTimesWrongInputShouldThrowAnException()
        {
            var sr = new StringReader("c");

            for (int i = 0; i < 6; i++)
            {
                Console.SetIn(sr);
                int?parsed = ConsoleManager.DimensionsInput("test", 1, 100);
            }
        }
示例#2
0
        public void TestInputMethodShouldParseNumberCorrectly()
        {
            var sr = new StringReader("1");

            Console.SetIn(sr);

            int?parsed = ConsoleManager.DimensionsInput("test", 1, 100);

            Assert.AreEqual(1, parsed);
        }