From e21ac149324f210301010b05544c2fb2415f84a3 Mon Sep 17 00:00:00 2001 From: sahar Date: Tue, 15 Feb 2022 18:18:51 +0100 Subject: [PATCH] UsbPlayerTest.GoToFirstTest Second Case --- src/main/java/device/usbPlayer/UsbPlayer.java | 2 +- src/test/java/device/usbPlayer/UsbPlayerTest.java | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/device/usbPlayer/UsbPlayer.java b/src/main/java/device/usbPlayer/UsbPlayer.java index 194128e..2a80289 100644 --- a/src/main/java/device/usbPlayer/UsbPlayer.java +++ b/src/main/java/device/usbPlayer/UsbPlayer.java @@ -212,6 +212,6 @@ public class UsbPlayer implements Device { } public void GoToFirst() { - setPlayTrack("Musik 01.mp3"); + setPlayTrack(getPlaylist().get(0)); } } diff --git a/src/test/java/device/usbPlayer/UsbPlayerTest.java b/src/test/java/device/usbPlayer/UsbPlayerTest.java index 5b12b03..762cd84 100644 --- a/src/test/java/device/usbPlayer/UsbPlayerTest.java +++ b/src/test/java/device/usbPlayer/UsbPlayerTest.java @@ -321,8 +321,13 @@ class UsbPlayerTest { UsbPlayer up1 = new UsbPlayer(); up1.GoToFirst(); + UsbPlayer up2 = new UsbPlayer(); + up2.GoToFirst(); + up2.GoToFirst(); + return Stream.of( - Arguments.of("It should go to the first Song ", up1,up1.getPlaylist().get(0)) + Arguments.of("It should go to the first Song ", up1,up1.getPlaylist().get(0)), + Arguments.of("Call the function twice and it stills go to the first Song ", up2,up2.getPlaylist().get(0)) ); }