コード例 #1
0
  @Test
  public void shouldStoreLastMeasurementForEachSensor() {
    triggerMeasurement("LHC", 150);
    triggerMeasurement("LHC2", 123);

    Sensor sensor2 = mock(Sensor.class);
    when(sensor2.getSensorName()).thenReturn("LHC2");

    assertThat(sessionManager.getNow(sensor), equalTo(150.0));
    assertThat(sessionManager.getNow(sensor2), equalTo(123.0));
  }
コード例 #2
0
 @Test
 public void shouldAssumeLastMeasurementIsZeroByDefault() {
   assertThat(sessionManager.getNow(sensor), equalTo(0.0));
 }