use of com.faendir.zachtronics.bot.sc.model.ScRecord in project zachtronics-leaderboard-bot by F43nd1r.
the class SolRepoFindTest method testGoodRecords.
@Test
public void testGoodRecords() {
ScRecord goodRecord = repository.find(ScPuzzle.research_example_1, ScCategory.C);
assertNotNull(goodRecord);
goodRecord = repository.find(ScPuzzle.published_40_3, ScCategory.S);
assertNotNull(goodRecord);
goodRecord = repository.find(ScPuzzle.sensing_6, ScCategory.RC);
assertNotNull(goodRecord);
goodRecord = repository.find(ScPuzzle.production_tutorial_1, ScCategory.C);
assertNotNull(goodRecord);
}
use of com.faendir.zachtronics.bot.sc.model.ScRecord in project zachtronics-leaderboard-bot by F43nd1r.
the class ScRecordDTO method fromCategoryRecord.
@NotNull
public static ScRecordDTO fromCategoryRecord(@NotNull CategoryRecord<ScRecord, ScCategory> categoryRecord) {
ScRecord record = categoryRecord.getRecord();
Set<ScCategory> categories = categoryRecord.getCategories();
return new ScRecordDTO(ScScoreDTO.fromScore(record.getScore()), record.getScore().toDisplayString(DisplayContext.plainText()), record.getAuthor(), record.getDisplayLink(), record.getDataLink(), UtilsKt.smartFormat(categories, UtilsKt.toMetricsTree(record.getPuzzle().getSupportedCategories())));
}
use of com.faendir.zachtronics.bot.sc.model.ScRecord in project zachtronics-leaderboard-bot by F43nd1r.
the class SolRepoFindTest method testBadRecord.
@Test
public void testBadRecord() {
ScRecord badRecord = repository.find(ScPuzzle.research_example_1, ScCategory.RC);
assertNull(badRecord);
badRecord = repository.find(ScPuzzle.research_example_1, ScCategory.CNP);
assertNull(badRecord);
badRecord = repository.find(ScPuzzle.bonding_7, ScCategory.RCNB);
assertNull(badRecord);
badRecord = repository.find(ScPuzzle.production_tutorial_1, ScCategory.RC);
assertNull(badRecord);
}
Aggregations