diff options
Diffstat (limited to 'android-app/app/src/test/kotlin')
| -rw-r--r-- | android-app/app/src/test/kotlin/org/terst/nav/data/api/WeatherApiServiceTest.kt | 6 | ||||
| -rw-r--r-- | android-app/app/src/test/kotlin/org/terst/nav/ui/fishing/RigAdvisorTest.kt | 16 |
2 files changed, 19 insertions, 3 deletions
diff --git a/android-app/app/src/test/kotlin/org/terst/nav/data/api/WeatherApiServiceTest.kt b/android-app/app/src/test/kotlin/org/terst/nav/data/api/WeatherApiServiceTest.kt index 1d35170..45e0687 100644 --- a/android-app/app/src/test/kotlin/org/terst/nav/data/api/WeatherApiServiceTest.kt +++ b/android-app/app/src/test/kotlin/org/terst/nav/data/api/WeatherApiServiceTest.kt @@ -64,9 +64,9 @@ class WeatherApiServiceTest { assertEquals(2, response.hourly.time.size) assertEquals(15.0, response.hourly.windspeed10m[0], 0.01) assertEquals(270.0, response.hourly.winddirection10m[0], 0.01) - assertEquals(18.5, response.hourly.temperature2m[0], 0.01) - assertEquals(20, response.hourly.precipitationProbability[0]) - assertEquals(1, response.hourly.weathercode[0]) + assertEquals(18.5, response.hourly.temperature2m!![0], 0.01) + assertEquals(20, response.hourly.precipitationProbability!![0]) + assertEquals(1, response.hourly.weathercode!![0]) } companion object { diff --git a/android-app/app/src/test/kotlin/org/terst/nav/ui/fishing/RigAdvisorTest.kt b/android-app/app/src/test/kotlin/org/terst/nav/ui/fishing/RigAdvisorTest.kt new file mode 100644 index 0000000..a19a412 --- /dev/null +++ b/android-app/app/src/test/kotlin/org/terst/nav/ui/fishing/RigAdvisorTest.kt @@ -0,0 +1,16 @@ +package org.terst.nav.ui.fishing + +import org.junit.Assert.* +import org.junit.Test + +class RigAdvisorTest { + @Test fun `warm water fast current favors Ono rig`() { + val rec = RigAdvisor.recommend(tempC = 26.0, currentKt = 1.5, windKt = 10.0) + assertEquals(FishingSpecies.ONO, rec.primarySpecies) + assertTrue(rec.trollingSpeedKt in 7.0..10.0) + } + @Test fun `cooler water moderate current favors mahi`() { + val rec = RigAdvisor.recommend(tempC = 23.0, currentKt = 0.5, windKt = 8.0) + assertEquals(FishingSpecies.MAHI, rec.primarySpecies) + } +} |
