Beispiel #1
0
        public void CheckColumns_GivenFullColumn_ShouldReturnTrue()
        {
            //arrange
            //playerName to be checked
            string playerName = "X";

            //new instance of board with allrows property

            string[] row1 = new string[3] {
                ".", "X", "."
            };
            string[] row2 = new string[3] {
                ".", "X", "."
            };
            string[] row3 = new string[3] {
                ".", "X", "."
            };

            string[][] allrows = new string[][] { new string[3] {
                                                      ".", "X", "."
                                                  }, row2, row3 };


            //new instance of the WinnerFinder function
            var instanceOfWinnerFinder = new WinnerFinder(allrows);

            //action
            bool columnHasWinner = instanceOfWinnerFinder.CheckColumns(playerName);

            //assert
            Assert.Equal(true, columnHasWinner);
        }
Beispiel #2
0
        public void CheckColumns_GivenFullColumn_ShouldReturnTrue_Inline(string[] row1, string[] row2, string[] row3, bool expected)
        {
            //arrange
            string playerName = "X";

            string[][] allrows = new string[][] { row1, row2, row3 };
            var        instanceOfWinnerFinder = new WinnerFinder(allrows);

            //action
            bool columnHasWinner = instanceOfWinnerFinder.CheckColumns(playerName);

            //assert
            Assert.Equal(expected, columnHasWinner);
        }