use of com.faendir.zachtronics.bot.sc.model.ScPuzzle in project zachtronics-leaderboard-bot by F43nd1r.
the class SolRepoFindTest method testFindCategoryHolders.
@Test
public void testFindCategoryHolders() {
ScPuzzle puzzle = ScPuzzle.research_example_1;
List<CategoryRecord<ScRecord, ScCategory>> categoryHolders = repository.findCategoryHolders(puzzle, false);
assertEquals(2, categoryHolders.size());
List<ScCategory> coveredCategories = categoryHolders.stream().map(CategoryRecord::getCategories).flatMap(Set::stream).sorted().toList();
assertEquals(puzzle.getSupportedCategories(), coveredCategories);
}
use of com.faendir.zachtronics.bot.sc.model.ScPuzzle in project zachtronics-leaderboard-bot by F43nd1r.
the class ScShowCommand method findPuzzleAndCategory.
@NotNull
@Override
public Pair<ScPuzzle, ScCategory> findPuzzleAndCategory(@NotNull ShowData parameters) {
ScPuzzle puzzle = parameters.puzzle;
ScCategory category = parameters.category;
if (!parameters.puzzle.getSupportedCategories().contains(category))
throw new IllegalArgumentException("Category " + category.getDisplayName() + " does not support " + puzzle.getDisplayName());
return new Pair<>(puzzle, category);
}
Aggregations