-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix scoreboard schema for Brilliance data, and add tests to catch thi…
…s earlier next time
- Loading branch information
Showing
3 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/test/kotlin/org/trackedout/listeners/BrillianceDataParserTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package org.trackedout.listeners | ||
|
||
import org.junit.jupiter.api.Test | ||
import org.trackedout.data.BrillianceCard | ||
import org.trackedout.data.BrillianceScoreboardDescription | ||
|
||
class BrillianceDataParserTest { | ||
val scoreboardsJsonPath = "data/brilliance-data/scoreboards.json" | ||
val cardsJsonPath = "data/brilliance-data/cards.json" | ||
|
||
@Test | ||
fun `scoreboards data parsing`() { | ||
val scoreboardData = this::class.java.classLoader.getResourceAsStream(scoreboardsJsonPath)!!.bufferedReader().use { it.readText() } | ||
json.decodeFromString<Map<String, BrillianceScoreboardDescription>>(scoreboardData) | ||
println("Successfully parsed scoreboards.json") | ||
} | ||
|
||
@Test | ||
fun `cards data parsing`() { | ||
val cardsData = this::class.java.classLoader.getResourceAsStream(cardsJsonPath)!!.bufferedReader().use { it.readText() } | ||
json.decodeFromString<Map<String, BrillianceCard>>(cardsData) | ||
println("Successfully parsed cards.json") | ||
} | ||
} |