Пример #1
0
        public void IsUserSure()
        {
            ConsoleInDriver.Instance.DriveLine("y");
            ConsoleInDriver.Instance.DriveLine("n");
            ConsoleInDriver.Instance.DriveLine("notagoodanswer");
            ConsoleInDriver.Instance.DriveLine("y");

            var cli          = new Cli();
            var firstAnswer  = cli.IsUserSure("Dude this is dangerous");
            var secondAnswer = cli.IsUserSure("Dude this is dangerous");
            var thirdAnswer  = cli.IsUserSure("Dude this is dangerous");

            Assert.IsTrue(firstAnswer);
            Assert.IsFalse(secondAnswer);
            Assert.IsTrue(thirdAnswer);
        }