From ba0578b7baaf5be475c8f12fae5254f846ab4017 Mon Sep 17 00:00:00 2001 From: sahar Date: Tue, 15 Feb 2022 18:22:50 +0100 Subject: [PATCH] UsbPlayerTest.GoToFirstTest third Case --- src/main/java/device/usbPlayer/UsbPlayer.java | 1 + src/test/java/device/usbPlayer/UsbPlayerTest.java | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/device/usbPlayer/UsbPlayer.java b/src/main/java/device/usbPlayer/UsbPlayer.java index 2a80289..c1233c6 100644 --- a/src/main/java/device/usbPlayer/UsbPlayer.java +++ b/src/main/java/device/usbPlayer/UsbPlayer.java @@ -212,6 +212,7 @@ public class UsbPlayer implements Device { } public void GoToFirst() { + //go to the first song in the list setPlayTrack(getPlaylist().get(0)); } } diff --git a/src/test/java/device/usbPlayer/UsbPlayerTest.java b/src/test/java/device/usbPlayer/UsbPlayerTest.java index 762cd84..25359e6 100644 --- a/src/test/java/device/usbPlayer/UsbPlayerTest.java +++ b/src/test/java/device/usbPlayer/UsbPlayerTest.java @@ -325,9 +325,14 @@ class UsbPlayerTest { up2.GoToFirst(); up2.GoToFirst(); + UsbPlayer up3 = new UsbPlayer(); + up3.next(); + up3.GoToFirst(); + return Stream.of( 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)) + Arguments.of("Call the function twice and it stills go to the first Song ", up2,up2.getPlaylist().get(0)), + Arguments.of("go to the next Song then back to first Song ", up3,up3.getPlaylist().get(0)) ); }