From 3a3df498360d81db2719191025123a9bb57be332 Mon Sep 17 00:00:00 2001 From: sahar Date: Fri, 18 Feb 2022 00:44:40 +0100 Subject: [PATCH] UsbPlayerTest.chooseItemTest third Case --- src/main/java/device/usbPlayer/UsbPlayer.java | 2 +- src/test/java/device/usbPlayer/UsbPlayerTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/device/usbPlayer/UsbPlayer.java b/src/main/java/device/usbPlayer/UsbPlayer.java index a6ea9fa..a5ca30e 100644 --- a/src/main/java/device/usbPlayer/UsbPlayer.java +++ b/src/main/java/device/usbPlayer/UsbPlayer.java @@ -188,7 +188,7 @@ public class UsbPlayer implements Device { Message= this.getPlaylist().get(itemNr ).toString(); }else if(itemNr < 0){ Message="The Nr is smaller than 0"; - } + }else Message="The Nr is bigger than 0"; return Message; } diff --git a/src/test/java/device/usbPlayer/UsbPlayerTest.java b/src/test/java/device/usbPlayer/UsbPlayerTest.java index 7be24cf..cb4e039 100644 --- a/src/test/java/device/usbPlayer/UsbPlayerTest.java +++ b/src/test/java/device/usbPlayer/UsbPlayerTest.java @@ -553,12 +553,12 @@ class UsbPlayerTest { static Stream chooseItem() { USB_Stick USBDrive = new USB_Stick(); - //first case UsbPlayer up1 = new UsbPlayer(USBDrive); 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), "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") ); }