diff --git a/src/main/java/device/usbPlayer/USB_Stick.java b/src/main/java/device/usbPlayer/USB_Stick.java index 4dd0fc6..39817e9 100644 --- a/src/main/java/device/usbPlayer/USB_Stick.java +++ b/src/main/java/device/usbPlayer/USB_Stick.java @@ -45,13 +45,6 @@ public class USB_Stick { Folders.add(a1); currentAlbum = 0; - for (int i = 0; i < Folders.size(); i++) { - for (int j = 0; j < Folders.get(0).size(); j++) { - System.out.println("the song is "+Folders.get(0).get(j)+"\n"); - - } - - } } public ArrayList getAlbum() throws NoFolderFound{ diff --git a/src/main/java/device/usbPlayer/UsbPlayer.java b/src/main/java/device/usbPlayer/UsbPlayer.java index ded0469..7e862b5 100644 --- a/src/main/java/device/usbPlayer/UsbPlayer.java +++ b/src/main/java/device/usbPlayer/UsbPlayer.java @@ -156,8 +156,13 @@ public class UsbPlayer implements Device { @Override public String getInfoText() { - - return "USB Player is on : "+this.getPlayTrack(); + String InfoText=""; + if (isAllAudio()) { + InfoText="USB Player is on : "+this.getPlayTrack(); + } + else + InfoText="USB Player with no Albums"; + return InfoText; } @Override diff --git a/src/test/java/device/usbPlayer/UsbPlayerTest.java b/src/test/java/device/usbPlayer/UsbPlayerTest.java index c44f026..92688cd 100644 --- a/src/test/java/device/usbPlayer/UsbPlayerTest.java +++ b/src/test/java/device/usbPlayer/UsbPlayerTest.java @@ -413,14 +413,21 @@ class UsbPlayerTest { static Stream getInfoTextOptions() { USB_Stick USBDrive = new USB_Stick(); + ArrayList Fileslist = new ArrayList(); + Fileslist.add("file 01.txt"); + Fileslist.add("file 02.txt"); + Fileslist.add("file 03.txt"); + USB_Stick USBwithTXT = new USB_Stick(Fileslist); //USB_Stick emptyUSB = new USB_Stick(""); //first case UsbPlayer up1 = new UsbPlayer(USBDrive); - + //Second case + UsbPlayer up2 = new UsbPlayer(USBwithTXT); return Stream.of( - Arguments.of("USB Player with Albums ", up1,"USB Player is on : "+up1.getPlayTrack()) + Arguments.of("USB Player with Albums ", up1,"USB Player is on : "+up1.getPlayTrack()), + Arguments.of("USB Player with no Albums ", up2,"USB Player with no Albums") ); }