Search in sources :

Example 1 with ScRecord

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);
}
Also used : ScRecord(com.faendir.zachtronics.bot.sc.model.ScRecord) Test(org.junit.jupiter.api.Test) BotTest(com.faendir.zachtronics.bot.BotTest)

Example 2 with ScRecord

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())));
}
Also used : ScRecord(com.faendir.zachtronics.bot.sc.model.ScRecord) ScCategory(com.faendir.zachtronics.bot.sc.model.ScCategory) NotNull(org.jetbrains.annotations.NotNull)

Example 3 with ScRecord

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);
}
Also used : ScRecord(com.faendir.zachtronics.bot.sc.model.ScRecord) Test(org.junit.jupiter.api.Test) BotTest(com.faendir.zachtronics.bot.BotTest)

Aggregations

ScRecord (com.faendir.zachtronics.bot.sc.model.ScRecord)3 BotTest (com.faendir.zachtronics.bot.BotTest)2 Test (org.junit.jupiter.api.Test)2 ScCategory (com.faendir.zachtronics.bot.sc.model.ScCategory)1 NotNull (org.jetbrains.annotations.NotNull)1