Navigation Menu

Skip to content

Commit

Permalink
Mocked Sensor in test given_psi_pressure_value_is_less_than_17_when_c…
Browse files Browse the repository at this point in the history
…heck_alarm_then_alarm_is_on().
  • Loading branch information
wubin28 committed Apr 11, 2014
1 parent 8ead805 commit 7466f18
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -17,6 +17,12 @@ public void when_check_alarm_then_get_characterization() {

@Test
public void given_psi_pressure_value_is_less_than_17_when_check_alarm_then_alarm_is_on() {
Sensor sensor = mock(Sensor.class);
when(sensor.popNextPressurePsiValue()).thenReturn(16.0);
Alarm alarm = new Alarm(sensor);

alarm.check();

assertThat(alarm.isAlarmOn()).isEqualTo(true);
}
}

0 comments on commit 7466f18

Please sign in to comment.