|
|
@ -192,16 +192,21 @@ void louderTest(String testName, UsbPlayer inputPlay, int expectedResult) { |
|
|
|
|
|
|
|
@ParameterizedTest |
|
|
|
@MethodSource("FindSongOptions") |
|
|
|
void findSongTest(String testName, UsbPlayer inputPlay, int expectedResult) { |
|
|
|
int songLocation = inputPlay.findSong("song 4"); |
|
|
|
assertThat(songLocation).describedAs(testName).isEqualTo(expectedResult); |
|
|
|
void findSongTest(String testName, int inputPlay, int expectedResult) { |
|
|
|
//first case: the song is not in the Album |
|
|
|
// int songLoc1 = inputPlay.findSong("song 4"); |
|
|
|
assertThat(inputPlay).describedAs(testName).isEqualTo(expectedResult);//songLoc1 |
|
|
|
//Second Case: the song is in the album |
|
|
|
// int songLoc2 = inputPlay.findSong("Musik 02"); |
|
|
|
assertThat(inputPlay).describedAs(testName).isEqualTo(expectedResult); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
static Stream<Arguments> FindSongOptions() { |
|
|
|
UsbPlayer up1 = new UsbPlayer(); |
|
|
|
|
|
|
|
return Stream.of( |
|
|
|
Arguments.of("The song is not in the Album", up1, -1) |
|
|
|
Arguments.of("The song is not in the Album", up1.findSong("song 4"), -1), |
|
|
|
Arguments.of("The song is in the Album", up1.findSong("Musik 02"), 1) |
|
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|