Created
June 10, 2019 02:41
-
-
Save d108/9899fcd8b94337e39ca22badc8fc2e14 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 testParseDaily2() | |
{ | |
val expected = 13 | |
val klx = Klaxon() | |
val dataKey = "Time Series (Daily)" | |
val days = klx.parseJsonObject(StringReader(File(pathname).readText())) | |
.filter { it.key == dataKey } | |
.map { it.value as JsonObject }.first().values | |
.map { klx.parseFromJsonObject<Daily>(it as JsonObject)?.close } | |
assertEquals(days.size, expected, "Bad count of " + days.size + ", expected " + expected + ".") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment