VastVideoToolbar extends LinearLayout { String getDisplaySeconds(final long millisecondsRemaining) { return String.valueOf(Math.round(Math.ceil(millisecondsRemaining / 1000f))); } VastVideoToolbar(final Context context);   }
@Test public void getDisplaySeconds_shouldReturnLongMillisecondsAsRoundedUpStringSeconds() throws Exception { assertThat(subject.getDisplaySeconds(0)).isEqualTo("0"); assertThat(subject.getDisplaySeconds(1)).isEqualTo("1"); assertThat(subject.getDisplaySeconds(999)).isEqualTo("1"); assertThat(subject.getDisplaySeconds(1000)).isEqualTo("1"); assertThat(subject.getDisplaySeconds(1001)).isEqualTo("2"); assertThat(subject.getDisplaySeconds(100000)).isEqualTo("100"); }