Browse Source

added play() and first test for first saved station

feature-pr-play
Jan Ortner 3 years ago
parent
commit
c350b06358
  1. 2
      src/main/java/device/radioPlayer/RadioPlayer.java
  2. 16
      src/test/java/device/radioPlayer/RadioPlayerTest.java

2
src/main/java/device/radioPlayer/RadioPlayer.java

@ -149,7 +149,7 @@ public class RadioPlayer implements Device {
@Override
public String play() {
return null;
return ("Radio is playing station: 0"+(Playlist.indexOf(playTrack)+1)+ " "+this.playTrack);
}
public String showStationInfo() {

16
src/test/java/device/radioPlayer/RadioPlayerTest.java

@ -164,10 +164,20 @@ class RadioPlayerTest {
@Test
void chooseOption() {
}
*/
@ParameterizedTest
@MethodSource("testPlayOptions")
void testPlay(String testName, RadioPlayer testRp, String expectedResult) {
String playedStation = testRp.play();
assertThat(playedStation).describedAs(testName).isEqualTo(expectedResult);
}
@Test
void play() {
static Stream<Arguments> testPlayOptions() {
RadioPlayer rp1 = new RadioPlayer();
return Stream.of(
Arguments.of("Test for playing first station on saved playlist", rp1, "Radio is playing station: 01 YouFM")
);
}
*/
}
Loading…
Cancel
Save