コード例 #1
0
        public void DifficultyLevelSelector_InputIs1_ReturnsEasyComputerPlayer()
        {
            TestConsoleInputRetriever inputRetriever = new TestConsoleInputRetriever("1");
            var actual = DifficultyLevelSelector.SetComputerPlayerLevel(inputRetriever);

            Assert.IsType <EasyComputerPlayer>(actual);
        }
コード例 #2
0
        public void DifficultyLevelSelector_InputIs4_ReturnsImpossibleComputerPlayer()
        {
            TestConsoleInputRetriever inputRetriever = new TestConsoleInputRetriever("4");
            var actual = DifficultyLevelSelector.SetComputerPlayerLevel(inputRetriever);

            Assert.IsType <ImpossibleComputerPlayer>(actual);
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: 37407/NoughtsAndCrosses
        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();
            }
        }