Ejemplo n.º 1
0
        public void GIVEN_new_game_WHEN_three_crosses_in_diagonal_from_top_right_THEN_cross_wins()
        {
            var game = new TTTGame();

            game.placeCross(0, 2);
            game.placeCircle(1, 0);
            game.placeCross(1, 1);
            game.placeCircle(2, 1);
            game.placeCross(2, 0);
            Assert.AreEqual(2, game.winner());
        }
Ejemplo n.º 2
0
        public void GIVEN_new_game_WHEN_three_crosses_in_left_column_THEN_cross_wins()
        {
            var game = new TTTGame();

            game.placeCross(0, 0);
            game.placeCircle(2, 1);
            game.placeCross(1, 0);
            game.placeCircle(2, 2);
            game.placeCross(2, 0);
            Assert.AreEqual(2, game.winner());
        }
Ejemplo n.º 3
0
        public void GIVEN_new_game_WHEN_three_circles_in_top_row_THEN_circle_wins()
        {
            var game = new TTTGame();

            game.placeCircle(0, 0);
            game.placeCross(1, 0);
            game.placeCircle(0, 1);
            game.placeCross(1, 1);
            game.placeCircle(0, 2);

            Assert.AreEqual(1, game.winner());
        }
Ejemplo n.º 4
0
        public void GIVEN_game_with_all_cells_occupied_WHEN_no_three_in_a_line_THEN_game_is_a_draw()
        {
            var game = new TTTGame();

            game.placeCircle(2, 2);
            game.placeCross(0, 0);
            game.placeCircle(0, 1);
            game.placeCross(0, 2);
            game.placeCircle(1, 0);
            game.placeCross(1, 1);
            game.placeCircle(1, 2);
            game.placeCross(2, 1);
            game.placeCircle(2, 0);

            Assert.AreEqual(3, game.winner());
        }