Exemplo n.º 1
0
        // Note: This method returns IEnumerable<string>
        // this is done to allow the method to return its title.
        // if you use this method make sure to yield return the title as the very first action
        IEnumerable<string> GivenTheFollowingBoard()
        {
            yield return string.Format(
                BoardStateTemplate, 
                string.Join(", ", _firstRow), 
                string.Join(", ", _secondRow), 
                string.Join(", ", _thirdRow));

            Game = new Game(_firstRow, _secondRow, _thirdRow);
        }
Exemplo n.º 2
0
        public bool Equals(Game other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;

            for (int i = 0; i < 3; i++)
            {
                if(!_board[i].SequenceEqual(other._board[i]))
                    return false;
            }

            return true;
        }
Exemplo n.º 3
0
 protected void GivenANewGame()
 {
     Game = new Game();
 }
Exemplo n.º 4
0
 void GivenTheFollowingBoard(string[] firstRow, string[] secondRow, string[] thirdRow)
 {
     Game = new Game(firstRow, secondRow, thirdRow);
 }