<commit_before>package com.java.laiy.controller;

import com.java.laiy.model.Board;
import com.java.laiy.model.Figure;
import com.java.laiy.model.Player;
import org.junit.Test;

import static org.junit.Assert.*;

public class RulesControllerTest {

    @Test
    public void testGetNextTurnWhenWin() throws Exception {
        final String gameName = "XO";
        final Figure testValueO = Figure.O;
        final Board board = new Board();
        final Player[] players = new Player[2];
        players[0] = new Player("Ox", Figure.X);
        players[1] = new Player("Xo", Figure.O);
        final GameController gameController = new GameController(gameName, players, board);
        final RulesController rulesController =new RulesController(gameController);
        gameController.move(1,1,players[1]);
        assertEquals(true,rulesController.getNextTurn());
        gameController.move(2,2,players[0]);
        assertEquals(true,rulesController.getNextTurn());
        gameController.move(0,2,players[1]);
        assertEquals(true,rulesController.getNextTurn());
        gameController.move(2,1,players[0]);
        assertEquals(true,rulesController.getNextTurn());
        gameController.move(2,0,players[1]);
        assertEquals(false,rulesController.getNextTurn());
    }

    @Test
    public void testGetNextTurnWhenFull() throws Exception {
        final String gameName = "XO";
        final Figure testValueO = Figure.O;
        final Board board = new Board();
        final Player[] players = new Player[2];
        players[0] = new Player("Ox", Figure.X);
        players[1] = new Player("Xo", Figure.O);
        final GameController gameController = new GameController(gameName, players, board);
        final RulesController rulesController =new RulesController(gameController);
        gameController.move(1,1,players[1]);
        assertEquals(true,rulesController.getNextTurn());
        gameController.move(2,2,players[0]);
        assertEquals(true,rulesController.getNextTurn());
        gameController.move(0,0,players[1]);
        assertEquals(true,rulesController.getNextTurn());
        gameController.move(0,1,players[0]);
        assertEquals(true,rulesController.getNextTurn());
        gameController.move(0,2,players[1]);
        assertEquals(true,rulesController.getNextTurn());
        gameController.move(1,0,players[0]);
        assertEquals(true,rulesController.getNextTurn());
        gameController.move(1,2,players[1]);
        assertEquals(true,rulesController.getNextTurn());
        gameController.move(2,0,players[0]);
        assertEquals(true,rulesController.getNextTurn());
        gameController.move(2,1,players[1]);
        assertEquals(false,rulesController.getNextTurn());
    }
}<commit_msg>RulesContollertest updated<commit_after>package com.java.laiy.controller;

import com.java.laiy.model.Board;
import com.java.laiy.model.Figure;
import com.java.laiy.model.Player;
import org.junit.Test;

import static org.junit.Assert.*;

public class RulesControllerTest {

    @Test
    public void testGetNextTurnWhenWin() throws Exception {
        final String gameName = "XO";
        final Board board = new Board();
        final Player[] players = new Player[2];
        players[0] = new Player("Ox", Figure.X);
        players[1] = new Player("Xo", Figure.O);
        final GameController gameController = new GameController(gameName, players, board);
        final RulesController rulesController =new RulesController(gameController);
        gameController.move(1,1,players[1]);
        assertEquals(true,rulesController.getNextTurn());
        gameController.move(2,2,players[0]);
        assertEquals(true,rulesController.getNextTurn());
        gameController.move(0,2,players[1]);
        assertEquals(true,rulesController.getNextTurn());
        gameController.move(2,1,players[0]);
        assertEquals(true,rulesController.getNextTurn());
        gameController.move(2,0,players[1]);
        assertEquals(false,rulesController.getNextTurn());
    }

    @Test
    public void testGetNextTurnWhenFull() throws Exception {
        final String gameName = "XO";
        final Board board = new Board();
        final Player[] players = new Player[2];
        players[0] = new Player("Ox", Figure.X);
        players[1] = new Player("Xo", Figure.O);
        final GameController gameController = new GameController(gameName, players, board);
        final RulesController rulesController =new RulesController(gameController);
        gameController.move(1,1,players[1]);
        assertEquals(true,rulesController.getNextTurn());
        gameController.move(2,2,players[0]);
        assertEquals(true,rulesController.getNextTurn());
        gameController.move(0,0,players[1]);
        assertEquals(true,rulesController.getNextTurn());
        gameController.move(0,1,players[0]);
        assertEquals(true,rulesController.getNextTurn());
        gameController.move(0,2,players[1]);
        assertEquals(true,rulesController.getNextTurn());
        gameController.move(1,0,players[0]);
        assertEquals(true,rulesController.getNextTurn());
        gameController.move(1,2,players[1]);
        assertEquals(true,rulesController.getNextTurn());
        gameController.move(2,0,players[0]);
        assertEquals(true,rulesController.getNextTurn());
        gameController.move(2,1,players[1]);
        assertEquals(false,rulesController.getNextTurn());
    }

}
{'fraction_non_alphanumeric': 0.12642830814596387, 'fraction_numerical': 0.017692591227423518, 'mean_word_length': 3.731473408892764, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4225514', 'n_tokens_mistral': 1511, 'n_tokens_neox': 1509, 'n_words': 257}