@ -183,11 +183,13 @@ public class UsbPlayer implements Device {
@Override
public String chooseItem(int itemNr) {
String songName="";
String Message="";
if (itemNr < this.getPlaylist().size() && itemNr >= 0) {
songName= this.getPlaylist().get(itemNr ).toString();
Message= this.getPlaylist().get(itemNr ).toString();
}else if(itemNr < 0){
Message="The Nr is smaller than 0";
}
return songName;
return Message;
@ -558,7 +558,7 @@ class UsbPlayerTest {
return Stream.of(
Arguments.of("An Item from the Album was chosen ", up1.chooseItem(0), "Musik 01.mp3"),
Arguments.of("Incorrect Nr of Item was given ", up1.chooseItem(-1), "")
Arguments.of("Incorrect Nr of Item was given ", up1.chooseItem(-1), "The Nr is smaller than 0")
);