コード例 #1
0
 @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");
 }
コード例 #2
0
 @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");
 }