예제 #1
0
        public void AcceptsIntegersInValidRange(string response, int min, int max, int expected)
        {
            var(stdOut, stdIn) = TestFx.ConsoleDefaults();

            int result = TestFx.HandleValidIntegerResponse("", response, min, max);

            Assert.Equal(expected, result);

            TestFx.ResetConsole(stdOut, stdIn);
        }
예제 #2
0
        public void ReturnsCorrectInteger(string prompt, string response, int expected)
        {
            var(stdOut, stdIn) = TestFx.ConsoleDefaults();

            int result = TestFx.HandleValidIntegerResponse(prompt, response);

            Assert.Equal(expected, result);

            TestFx.ResetConsole(stdOut, stdIn);
        }