|
@ -1,6 +1,7 @@ |
|
|
package device.radioPlayer; |
|
|
package device.radioPlayer; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.assertj.core.util.Strings; |
|
|
import org.junit.jupiter.api.Test; |
|
|
import org.junit.jupiter.api.Test; |
|
|
import org.junit.jupiter.params.ParameterizedTest; |
|
|
import org.junit.jupiter.params.ParameterizedTest; |
|
|
import org.junit.jupiter.params.provider.Arguments; |
|
|
import org.junit.jupiter.params.provider.Arguments; |
|
@ -373,4 +374,20 @@ class RadioPlayerTest { |
|
|
rp.unmute(); |
|
|
rp.unmute(); |
|
|
assertThat(rp.getVolume()).describedAs("Test if unmute is setting the saved volume").isEqualTo(rp.savedVolume); |
|
|
assertThat(rp.getVolume()).describedAs("Test if unmute is setting the saved volume").isEqualTo(rp.savedVolume); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ParameterizedTest |
|
|
|
|
|
@MethodSource("getInfoTextOptions") |
|
|
|
|
|
void testGetInfoText(String testName, RadioPlayer testRp, boolean expectedResult) { |
|
|
|
|
|
Boolean volume = Strings.isNullOrEmpty(testRp.getInfoText()); |
|
|
|
|
|
|
|
|
|
|
|
assertThat(volume).describedAs(testName).isEqualTo(expectedResult); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static Stream<Arguments> getInfoTextOptions() { |
|
|
|
|
|
RadioPlayer rp = new RadioPlayer(); |
|
|
|
|
|
|
|
|
|
|
|
return Stream.of( |
|
|
|
|
|
Arguments.of("Test for getInfoText is not empty or null", rp, false) |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
} |
|
|
} |