|
|
@ -491,6 +491,27 @@ class CDPlayerTest { |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
@ParameterizedTest |
|
|
|
@MethodSource("addToFavoriteSongsData") |
|
|
|
void addToFavoriteSongs(String testName,String cases, CDPlayer _cdPlayer,Exception exception) { |
|
|
|
String myFavoriteSong=_cdPlayer.getCD().getPlayList()[0]; |
|
|
|
_cdPlayer.addToFavoriteSongs(myFavoriteSong); |
|
|
|
assertThat(_cdPlayer.getFavoriteSongs().get(0)).describedAs(testName).isEqualTo(myFavoriteSong); |
|
|
|
|
|
|
|
} |
|
|
|
static Stream<Arguments> addToFavoriteSongsData () { |
|
|
|
String[] audioPlayList = new String[]{"Audio 01", "Audio 02", "Audio 03", "Audio 04", "Audio 05"}; |
|
|
|
CD audioCD1 = new CD("Audio", "PopMusic", audioPlayList, "XAc20044"); |
|
|
|
CD audioCD2=new CD("Audio","RockMusic",audioPlayList,"BLXPP78"); |
|
|
|
|
|
|
|
CDPlayer cdPlayer1 = new CDPlayer(); |
|
|
|
cdPlayer1.changePlaySource(); |
|
|
|
cdPlayer1.loadCDWechseler(audioCD1, 0); |
|
|
|
cdPlayer1.loadCDWechseler(audioCD2, 1); |
|
|
|
|
|
|
|
return Stream.of( |
|
|
|
Arguments.of("[addToFavoriteSongs() by addingOneSong] => favoriteSongsShouldReturnsThatAddedSong", "Case1", cdPlayer1, null) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
} |