Skip to content

Add unit tests for GeoUtils — distanceMiles and fuelLabel #6

@GavT

Description

@GavT

Summary

GeoUtils.kt contains pure functions distanceMiles() (Haversine formula) and fuelLabel() (fuel code mapping) with no test coverage.

What to test

File: backend/src/main/kotlin/uk/co/fueller/backend/GeoUtils.kt

Test Description
distanceMiles_zeroForSamePoint Same lat/lon → 0.0 miles
distanceMiles_londonToManchester Known distance within ~1% tolerance
distanceMiles_antipodal ~12,450 miles for opposite points
fuelLabel_E10 Returns "Unleaded" or expected label
fuelLabel_B7 Returns "Diesel"
fuelLabel_unknown Returns raw code or graceful fallback

Workstream: WS2 Phase 2A

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Hardening / refinement / nice-to-have — not blocking launchWS2-testingWorkstream 2 – TestingtestingTest coverage task

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions