Created
June 10, 2019 01:54
-
-
Save d108/409ecca30fd75f7c8215d14a2abb93d5 to your computer and use it in GitHub Desktop.
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
@Test fun testParseDaily1() | |
{ | |
val cnt = 0 | |
val dataKey = "Time Series (Daily)" | |
val klx = Klaxon() | |
val f = File(pathname).readText() | |
val parsed = klx.parseJsonObject(StringReader(f)) | |
val timeSeries = parsed.filter { | |
it.key == dataKey | |
}.map { | |
it.value as JsonObject | |
} | |
timeSeries.first().values.forEach { | |
cnt.inc() | |
val day = klx.parseFromJsonObject<Daily>(it as JsonObject) | |
} | |
assertEquals(cnt, 0, "Expected fall-through.") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment