Browse Source

UsbPlayerTest.chooseItemTest third Case

feature-pr-USB-otherTests
sahar 3 years ago
parent
commit
3a3df49836
  1. 2
      src/main/java/device/usbPlayer/UsbPlayer.java
  2. 4
      src/test/java/device/usbPlayer/UsbPlayerTest.java

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

@ -188,7 +188,7 @@ public class UsbPlayer implements Device {
Message= this.getPlaylist().get(itemNr ).toString(); Message= this.getPlaylist().get(itemNr ).toString();
}else if(itemNr < 0){ }else if(itemNr < 0){
Message="The Nr is smaller than 0"; Message="The Nr is smaller than 0";
}
}else Message="The Nr is bigger than 0";
return Message; return Message;
} }

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

@ -553,12 +553,12 @@ class UsbPlayerTest {
static Stream<Arguments> chooseItem() { static Stream<Arguments> chooseItem() {
USB_Stick USBDrive = new USB_Stick(); USB_Stick USBDrive = new USB_Stick();
//first case
UsbPlayer up1 = new UsbPlayer(USBDrive); UsbPlayer up1 = new UsbPlayer(USBDrive);
return Stream.of( return Stream.of(
Arguments.of("An Item from the Album was chosen ", up1.chooseItem(0), "Musik 01.mp3"), 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), "The Nr is smaller than 0")
Arguments.of("Incorrect Nr of Item was given < 0", up1.chooseItem(-1), "The Nr is smaller than 0"),
Arguments.of("Incorrect Nr of Item was given > 0", up1.chooseItem(5), "The Nr is bigger than 0")
); );
} }
Loading…
Cancel
Save