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

Added tests for RandomWangTileGenerator

parent d7ce6921
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 RandomWangTileGeneratorTest {
@Test
void testNextTile(){
TileGenerator tileGenerator = new RandomWangTileGenerator(List.of(Color.RED, Color.BLUE), new Random(0));
Side redSide = new ColoredSide(Color.RED);
Side blueSide = new ColoredSide(Color.BLUE);
for(int index = 0; index < 10; index++)
for(CardinalDirection direction : CardinalDirection.values())
assertThat(tileGenerator.nextTile(EmptySquare.EMPTY_SQUARE).side(direction)).isIn(List.of(redSide, blueSide));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment