Skip to content
Snippets Groups Projects
Commit 208a38c8 authored by LABOUREL Arnaud's avatar LABOUREL Arnaud
Browse files

Added tests for RandomUniformTileGenerator

parent 7cf2a1ef
No related branches found
No related tags found
No related merge requests found
package model;
import javafx.scene.paint.Color;
import org.junit.jupiter.api.Test;
import java.util.List;
import java.util.Random;
import static org.assertj.core.api.Assertions.assertThat;
public class RandomUniformTileGeneratorTest {
@Test
void testNextTile(){
TileGenerator tileGenerator = new RandomUniformTileGenerator(List.of(Color.RED, Color.BLUE), new Random(0));
Tile redTile = new UniformTile(new ColoredSide(Color.RED));
Tile blueTile = new UniformTile(new ColoredSide(Color.BLUE));
for(int index = 0; index < 10; index++)
assertThat(tileGenerator.nextTile(EmptySquare.EMPTY_SQUARE)).isIn(List.of(blueTile, redTile));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment