@Test public void testGetWaveHeight_Nautical() { BuoyDetailViewModel viewModel = new BuoyDetailViewModel(WIND_CONDTIONS, WAVE_CONDITION, makeNauticalPreferences()); viewModel.updateWaveHeight(mockInstrument); assertThat(mockInstrument.value).isEqualTo("5.0"); assertThat(mockInstrument.units).isEqualTo("ft"); }
@Test public void testGetWaveHeight_Metric() { BuoyDetailViewModel viewModel = new BuoyDetailViewModel(WIND_CONDTIONS, WAVE_CONDITION, makeMetricPreferences()); viewModel.updateWaveHeight(mockInstrument); assertThat(mockInstrument.value).isEqualTo("1.5"); assertThat(mockInstrument.units).isEqualTo("m"); }