Browse Source

UsbPlayerTest.setPlayTrackTest Third Case

feature-pr-USB-otherTests
sahar 3 years ago
parent
commit
308057ae4b
  1. 5
      src/main/java/device/usbPlayer/UsbPlayer.java
  2. 7
      src/test/java/device/usbPlayer/UsbPlayerTest.java

5
src/main/java/device/usbPlayer/UsbPlayer.java

@ -43,8 +43,9 @@ public class UsbPlayer implements Device {
}
public void setPlayTrack(String playTrack) {
if(this.findSong(playTrack) != -1)
this.playTrack = playTrack;
if(this.findSong(playTrack) != -1){
this.playTrack = playTrack;}
else System.out.println("The Song does not exist in the Albume");
}

7
src/test/java/device/usbPlayer/UsbPlayerTest.java

@ -380,9 +380,14 @@ class UsbPlayerTest {
UsbPlayer up2 = new UsbPlayer();
up2.setPlayTrack("Musik 02.mp3");
//Third Case
UsbPlayer up3 = new UsbPlayer();
up3.setPlayTrack("Musik 04.mp3");
return Stream.of(
Arguments.of("It should change the current Song ", up1,"Musik 02.mp3"),
Arguments.of("It should change the current Song if it is in the Albume", up2,"Musik 02.mp3")
Arguments.of("It should change the current Song if it is in the Albume", up2,"Musik 02.mp3"),
Arguments.of("Tried to change the Song,but the Song name does not exist in the Album(No change)", up3,"Musik 01.mp3")
);
}
Loading…
Cancel
Save