@Test
public void testUi() {

    final TextView speedLimitView = mGuidanceSpeedLimitView.findViewById(R.id.speed_limit);
    GuidanceSpeedData data;
    mGuidanceSpeedLimitView.setCurrentSpeedData(null);
    assertThat(mGuidanceSpeedLimitView.getVisibility(), is(View.GONE));
    data = new GuidanceSpeedData(45.0, SPEED_LIMIT);
    mGuidanceSpeedLimitView.setCurrentSpeedData(data);
    assertThat(mGuidanceSpeedLimitView.getVisibility(), is(View.VISIBLE));
    assertThat(speedLimitView.getText().toString(),
            is(String.valueOf(SpeedFormatterUtil.format(50, UnitSystem.METRIC))));
    data = new GuidanceSpeedData(60.0, SPEED_LIMIT);
    mGuidanceSpeedLimitView.setCurrentSpeedData(data);
    assertThat(mGuidanceSpeedLimitView.getVisibility(), is(View.VISIBLE));
    assertThat(speedLimitView.getText().toString(),
            is(String.valueOf(SpeedFormatterUtil.format(50, UnitSystem.METRIC))));
    data = new GuidanceSpeedData(150.0, 0.0);
    mGuidanceSpeedLimitView.setCurrentSpeedData(data);
    assertThat(mGuidanceSpeedLimitView.getVisibility(), is(View.GONE));
    data = new GuidanceSpeedData(45.0, SPEED_LIMIT);
    mGuidanceSpeedLimitView.setCurrentSpeedData(data);
    assertThat(mGuidanceSpeedLimitView.getVisibility(), is(View.VISIBLE));
    assertThat(speedLimitView.getText().toString(),
            is(String.valueOf(SpeedFormatterUtil.format(50, UnitSystem.METRIC))));
}