<commit_before>package nl.mvdr.tinustris.engine.level;

import java.util.ArrayList;
import java.util.List;

import org.junit.Test;

import nl.mvdr.tinustris.input.InputStateHistory;
import nl.mvdr.tinustris.model.GameState;
import nl.mvdr.tinustris.model.Tetromino;

/**
 * Abstract superclass for test cases for implementations of {@link LevelSystem}.
 * 
 * @author <NAME>
 */
public abstract class LevelSystemTester {
    /** Test method that symply invokes {@link AbstractLevelSystem#computeLevel(GameState, GameState)}. */
    @Test
    public void testSameState() {
        GameState state = createGameState(0, 0, 0);
        AbstractLevelSystem levelSystem = createLevelSystem();
        
        levelSystem.computeLevel(state, state);
    }
    
    /** Test method that symply invokes {@link AbstractLevelSystem#computeLevel(GameState, GameState)}. */
    @Test
    public void testDifferentStates() {
        GameState previousState = createGameState(0, 0, 0);
        GameState newState = createGameState(0, 0, 0);
        AbstractLevelSystem levelSystem = createLevelSystem();
        
        levelSystem.computeLevel(previousState, newState);
    }
    
    /**
     * Creates a game state with the given parameters.
     * 
     * @param blockCounter block counter
     * @param level level
     * @return game state
     */
    GameState createGameState(int blockCounter, int lines, int level) {
        List<Tetromino> grid = new ArrayList<>(220);
        for (int i = 0; i != 220; i++) {
            grid.add(null);
        }
        GameState state = new GameState(grid, 10, null, null, null, Tetromino.Z, 0, 0, 0, new InputStateHistory(),<commit_msg>Javadoc.<commit_after>package nl.mvdr.tinustris.engine.level;

import java.util.ArrayList;
import java.util.List;

import org.junit.Test;

import nl.mvdr.tinustris.input.InputStateHistory;
import nl.mvdr.tinustris.model.GameState;
import nl.mvdr.tinustris.model.Tetromino;

/**
 * Abstract superclass for test cases for implementations of {@link LevelSystem}.
 * 
 * @author <NAME>
 */
public abstract class LevelSystemTester {
    /** Test method that symply invokes {@link AbstractLevelSystem#computeLevel(GameState, GameState)}. */
    @Test
    public void testSameState() {
        GameState state = createGameState(0, 0, 0);
        AbstractLevelSystem levelSystem = createLevelSystem();
        
        levelSystem.computeLevel(state, state);
    }
    
    /** Test method that symply invokes {@link AbstractLevelSystem#computeLevel(GameState, GameState)}. */
    @Test
    public void testDifferentStates() {
        GameState previousState = createGameState(0, 0, 0);
        GameState newState = createGameState(0, 0, 0);
        AbstractLevelSystem levelSystem = createLevelSystem();
        
        levelSystem.computeLevel(previousState, newState);
    }
    
    /**
     * Creates a game state with the given parameters.
     * 
     * @param blockCounter block counter
     * @param lines lines
     * @param level level
     * @return game state
     */
    GameState createGameState(int blockCounter, int lines, int level) {
        List<Tetromino> grid = new ArrayList<>(220);
        for (int i = 0; i != 220; i++) {
            grid.add(null);
        }
        GameState state = new GameState(grid, 10, null, null, null, Tetromino.Z, 0, 0, 0, new InputStateHistory(),
{'fraction_non_alphanumeric': 0.10615521855486174, 'fraction_numerical': 0.012488849241748439, 'mean_word_length': 3.0677146311970978, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '424555', 'n_tokens_mistral': 1015, 'n_tokens_neox': 971, 'n_words': 262}