/** * Creates a new instance of <code>{@link FloatAssert}</code>. * @param actual the actual value. * @return the created assertion object. */ public static FloatAssert assertThat(float actual) { return new FloatAssert(actual); }
@Test public void givenNoVolumeWasSet_whenGettingVolume_theReturnsOne() { givenMediaPlayerIsPrepared(); float currentVolume = facade.getVolume(); assertThat(currentVolume).isEqualTo(1f); }
@Test public void givenVolumeWasSet_whenGettingVolume_theReturnsSetVolume() { givenMediaPlayerIsPrepared(); facade.setVolume(ANY_VOLUME); float currentVolume = facade.getVolume(); assertThat(currentVolume).isEqualTo(ANY_VOLUME); }
@Test public void whenGetVolume_thenGetsPlayerVolume() { given(exoPlayer.getVolume()).willReturn(ANY_VOLUME); float currentVolume = facade.getVolume(); assertThat(currentVolume).isEqualTo(ANY_VOLUME); }
/** * Creates a new instance of <code>{@link FloatAssert}</code>. * @param actual the actual value. * @return the created assertion object. */ public static FloatAssert assertThat(Float actual) { return new FloatAssert(actual); }
@Test public void whenGetVolume_thenReturnVolumeFromExoPlayer() { given(exoPlayerFacade.getVolume()).willReturn(ANY_VOLUME); float currentVolume = player.getVolume(); assertThat(currentVolume).isEqualTo(ANY_VOLUME); } }
@Test public void whenGetVolume_thenReturnMediaPlayerVolume() { given(mediaPlayer.getVolume()).willReturn(ANY_VOLUME); float currentVolume = player.getVolume(); assertThat(currentVolume).isEqualTo(ANY_VOLUME); }