@Test public void formatTime_shouldReturnLongMillisecondsAsFormattedString() { assertThat(subject.formatTime(-8999)).isEqualTo("-8 seconds"); assertThat(subject.formatTime(-9000)).isEqualTo("-9 seconds"); assertThat(subject.formatTime(-9001)).isEqualTo("-9 seconds"); assertThat(subject.formatTime(0)).isEqualTo("0 seconds"); assertThat(subject.formatTime(1)).isEqualTo("1 second"); assertThat(subject.formatTime(1000)).isEqualTo("1 second"); assertThat(subject.formatTime(1005)).isEqualTo("2 seconds"); assertThat(subject.formatTime(59999)).isEqualTo("60 seconds"); assertThat(subject.formatTime(60000)).isEqualTo("60 seconds"); assertThat(subject.formatTime(60001)).isEqualTo("61 seconds"); assertThat(subject.formatTime(853437)).isEqualTo("854 seconds"); assertThat(subject.formatTime(3599999)).isEqualTo("3600 seconds"); assertThat(subject.formatTime(3600000)).isEqualTo("3600 seconds"); assertThat(subject.formatTime(3600001)).isEqualTo("3601 seconds"); assertThat(subject.formatTime(3660001)).isEqualTo("3661 seconds"); assertThat(subject.formatTime(65784693)).isEqualTo("65785 seconds"); }
@VisibleForTesting String formatTime(final long milliseconds) { final long seconds = convertMillisecondsToSecondsRoundedUp(milliseconds); if (seconds == 1) { return "1 second"; } else { return String.valueOf(seconds) + " seconds"; } }
VastVideoToolbar extends LinearLayout { @VisibleForTesting String formatTime(final long milliseconds) { final long seconds = convertMillisecondsToSecondsRoundedUp(milliseconds); if (seconds == 1) { return "1 second"; } else { return String.valueOf(seconds) + " seconds"; } } }
VastVideoToolbar extends LinearLayout { @VisibleForTesting String formatTime(final long milliseconds) { final long seconds = convertMillisecondsToSecondsRoundedUp(milliseconds); if (seconds == 1) { return "1 second"; } else { return String.valueOf(seconds) + " seconds"; } } VastVideoToolbar(final Context context); }
VastVideoToolbar extends LinearLayout { @VisibleForTesting String formatTime(final long milliseconds) { final long seconds = convertMillisecondsToSecondsRoundedUp(milliseconds); if (seconds == 1) { return "1 second"; } else { return String.valueOf(seconds) + " seconds"; } } VastVideoToolbar(final Context context);  }
VastVideoToolbar extends LinearLayout { @VisibleForTesting String formatTime(final long milliseconds) { final long seconds = convertMillisecondsToSecondsRoundedUp(milliseconds); if (seconds == 1) { return "1 second"; } else { return String.valueOf(seconds) + " seconds"; } } VastVideoToolbar(final Context context);   }