summaryrefslogtreecommitdiff
path: root/android-app/app/src/test
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-06-30 18:35:29 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-06-30 18:35:29 +0000
commit82112d0c0b8c31ad436f52c9003d480b7132a3f1 (patch)
tree9dc3b5e83be55567138fec687f8bc4a4b6d5baad /android-app/app/src/test
parent9af38934e8d676bfb8c08ab01e3d57fec5f36d97 (diff)
feat(fishing): FishingTarget + RigAdvisor logic
Also fix pre-existing test compile errors in WeatherApiServiceTest (nullable list access) and add missing metresToFeet/formatFt helpers to InstrumentHandler. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'android-app/app/src/test')
-rw-r--r--android-app/app/src/test/kotlin/org/terst/nav/data/api/WeatherApiServiceTest.kt6
-rw-r--r--android-app/app/src/test/kotlin/org/terst/nav/ui/fishing/RigAdvisorTest.kt16
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)
+ }
+}