public void DifficultyLevelSelector_InputIs1_ReturnsEasyComputerPlayer()
        {
            TestConsoleInputRetriever inputRetriever = new TestConsoleInputRetriever("1");
            var actual = DifficultyLevelSelector.SetComputerPlayerLevel(inputRetriever);

            Assert.IsType <EasyComputerPlayer>(actual);
        }
        public void DifficultyLevelSelector_InputIs4_ReturnsImpossibleComputerPlayer()
        {
            TestConsoleInputRetriever inputRetriever = new TestConsoleInputRetriever("4");
            var actual = DifficultyLevelSelector.SetComputerPlayerLevel(inputRetriever);

            Assert.IsType <ImpossibleComputerPlayer>(actual);
        }
示例#3
0
        static void Main(string[] args)
        {
            bool runGame = true;
            ConsoleInputRetriever inputRetriever = new ConsoleInputRetriever();

            while (runGame)
            {
                IPlayer    computerPlayer = DifficultyLevelSelector.SetComputerPlayerLevel(inputRetriever);
                GameRunner gameRunner     = new GameRunner(inputRetriever, new HumanPlayer(inputRetriever), computerPlayer);
                runGame = gameRunner.RunGame();
            }
        }