|
|
@ -86,4 +86,32 @@ void louderTest(String testName, UsbPlayer inputPlay, int expectedResult) { |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ParameterizedTest |
|
|
|
@MethodSource("NextOptions") |
|
|
|
void NextTest(String testName, UsbPlayer inputPlay, String expectedResult) { |
|
|
|
String current_Track = inputPlay.getPlayTrack(); |
|
|
|
assertThat(current_Track).describedAs(testName).isEqualTo(expectedResult); |
|
|
|
} |
|
|
|
|
|
|
|
static Stream<Arguments> NextOptions() { |
|
|
|
UsbPlayer up1 = new UsbPlayer(); |
|
|
|
up1.next(); |
|
|
|
UsbPlayer up2 = new UsbPlayer(); |
|
|
|
for (int i = 1; i < up2.getPlaylist().size(); i++) { |
|
|
|
up2.next(); |
|
|
|
} |
|
|
|
UsbPlayer up3 = new UsbPlayer(); |
|
|
|
for (int i = 1; i < up3.getPlaylist().size(); i++) { |
|
|
|
up3.next(); |
|
|
|
} |
|
|
|
up3.next(); |
|
|
|
return Stream.of( |
|
|
|
Arguments.of("Second-Song : Musik 02.mp3 ", up1, "Musik 02.mp3"), |
|
|
|
Arguments.of("Last-Song : Musik 03.mp3 ", up2, "Musik 03.mp3"), |
|
|
|
Arguments.of("From last to first Song : Musik 01.mp3 ", up3, "Musik 01.mp3") |
|
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
} |