use of core.neighbor.Neighbor in project solution-finder by knewjade.
the class LockedNeighborCandidateTest method testField.
@ParameterizedTest
@ArgumentsSource(FieldTestCase.class)
void testField(Field field, Piece piece) {
Injector injector = Guice.createInjector(new BasicModule());
int maxClearLine = 4;
LockedCandidate candidate1 = createLockedCandidate(injector, maxClearLine);
LockedNeighborCandidate candidate2 = createLockedNeighborCandidate(injector, maxClearLine);
MinoShifter minoShifter = injector.getInstance(MinoShifter.class);
// LockedCandidate
Set<Action> search1 = candidate1.search(field, piece, maxClearLine);
// LockedNeighborCandidate
Set<Neighbor> neighbors = candidate2.search(field, piece, maxClearLine);
Set<Action> search2 = neighbors.stream().map(Neighbor::getPiece).map(this::createMinimalAction).map(action -> minoShifter.createTransformedAction(piece, action)).collect(Collectors.toSet());
assertThat(search2).isEqualTo(search1);
}
Aggregations