use of module.BasicModule in project solution-finder by knewjade.
the class LockedNeighborReachableTest method checks1.
@Test
void checks1() {
int maxClearLine = 4;
Injector injector = Guice.createInjector(new BasicModule(maxClearLine));
LockedNeighborReachable reachable = createLockedNeighborReachable(injector, maxClearLine);
Field field = FieldFactory.createField("" + "XXXX______" + "___X______" + "___X______" + "__________");
assertThat(reachable.checks(field, new Mino(Piece.T, Rotate.Spawn), 8, 0, maxClearLine)).isTrue();
assertThat(reachable.checks(field, new Mino(Piece.T, Rotate.Spawn), 1, 0, maxClearLine)).isFalse();
}
use of module.BasicModule in project solution-finder by knewjade.
the class NeighborsTest method getJ.
@Test
void getJ() {
Injector injector = Guice.createInjector(new BasicModule());
Neighbors neighbors = createNeighbors(injector);
Neighbor neighbor = neighbors.get(Piece.J, Rotate.Left, 3, 2);
assertThat(neighbor.getPiece()).returns(Piece.J, OriginalPiece::getPiece).returns(Rotate.Left, OriginalPiece::getRotate).returns(3, OriginalPiece::getX).returns(2, OriginalPiece::getY);
}
use of module.BasicModule in project solution-finder by knewjade.
the class NeighborsTest method getT.
@Test
void getT() {
Injector injector = Guice.createInjector(new BasicModule());
Neighbors neighbors = createNeighbors(injector);
Neighbor neighbor = neighbors.get(Piece.O, Rotate.Spawn, 1, 0);
assertThat(neighbor.getPiece()).returns(Piece.O, OriginalPiece::getPiece).returns(Rotate.Spawn, OriginalPiece::getRotate).returns(1, OriginalPiece::getX).returns(0, OriginalPiece::getY);
}
use of module.BasicModule in project solution-finder by knewjade.
the class NeighborsTest method getS.
@Test
void getS() {
Injector injector = Guice.createInjector(new BasicModule());
Neighbors neighbors = createNeighbors(injector);
Neighbor neighbor = neighbors.get(Piece.S, Rotate.Reverse, 8, 3);
assertThat(neighbor.getPiece()).returns(Piece.S, OriginalPiece::getPiece).returns(Rotate.Reverse, OriginalPiece::getRotate).returns(8, OriginalPiece::getX).returns(3, OriginalPiece::getY);
}
use of module.BasicModule in project solution-finder by knewjade.
the class NeighborsTest method nextLeftRotateSources.
@Test
void nextLeftRotateSources() {
Injector injector = Guice.createInjector(new BasicModule(6));
Neighbors neighbors = createNeighbors(injector);
Neighbor neighbor = neighbors.get(Piece.T, Rotate.Spawn, 4, 3);
assertThat(neighbor.getNextLeftRotateSources()).containsExactlyInAnyOrder(neighbors.get(Piece.T, Rotate.Right, 4, 3), neighbors.get(Piece.T, Rotate.Right, 3, 3), neighbors.get(Piece.T, Rotate.Right, 3, 4), neighbors.get(Piece.T, Rotate.Right, 4, 1), neighbors.get(Piece.T, Rotate.Right, 3, 1));
}
Aggregations