File tree Expand file tree Collapse file tree
lib/src/test/kotlin/com/openmeteo/api/ecmwf Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package com.openmeteo.api.ecmwf
2+
3+ import com.openmeteo.api.common.params.IsoDate
4+ import kotlinx.serialization.ExperimentalSerializationApi
5+ import com.openmeteo.api.ecmwf.params.*
6+ import kotlin.test.*
7+
8+ class EcmwfEndpointTest {
9+
10+ companion object {
11+ val endpoint = EcmwfEndpoint ()
12+ }
13+
14+ @Test
15+ @ExperimentalSerializationApi
16+ fun `Empty query doesn't throw` () {
17+ endpoint().getOrThrow()
18+ }
19+
20+ @Test
21+ @ExperimentalSerializationApi
22+ fun `Wind speeds of 2022-08-01` () {
23+ val response = endpoint(
24+ hourly = listOf (Hourly .windspeed_10m),
25+ startDate = IsoDate (" 2022-08-01" ),
26+ endDate = IsoDate (" 2022-08-01" ),
27+ ).getOrThrow()
28+ val hourly = response.hourly!!
29+ val hourlyWindSpeed = hourly.windspeed_10m!!
30+ assertContentEquals(arrayOf(
31+ 14.1f ,
32+ 10.5f ,
33+ 14.9f ,
34+ 15.1f ,
35+ 11.2f ,
36+ 14.4f ,
37+ 9.4f ,
38+ 6.1f ,
39+ ), hourlyWindSpeed)
40+ }
41+ }
You can’t perform that action at this time.
0 commit comments