diff --git a/src/main/java/device/usbPlayer/UsbPlayer.java b/src/main/java/device/usbPlayer/UsbPlayer.java index 992ba76..194128e 100644 --- a/src/main/java/device/usbPlayer/UsbPlayer.java +++ b/src/main/java/device/usbPlayer/UsbPlayer.java @@ -211,4 +211,7 @@ public class UsbPlayer implements Device { return false; } + public void GoToFirst() { + setPlayTrack("Musik 01.mp3"); + } } diff --git a/src/test/java/device/usbPlayer/UsbPlayerTest.java b/src/test/java/device/usbPlayer/UsbPlayerTest.java index 9c553f8..5b12b03 100644 --- a/src/test/java/device/usbPlayer/UsbPlayerTest.java +++ b/src/test/java/device/usbPlayer/UsbPlayerTest.java @@ -309,5 +309,22 @@ class UsbPlayerTest { ); } + //GoToFirst() + @ParameterizedTest + @MethodSource("GoToFirstOptions") + void GoToFirstTest(String testName, UsbPlayer inputUSB, String expectedResult) { + String firstSong = inputUSB.getPlayTrack(); + assertThat(firstSong ).describedAs(testName).isEqualTo(expectedResult); + } + + static Stream GoToFirstOptions() { + UsbPlayer up1 = new UsbPlayer(); + up1.GoToFirst(); + + return Stream.of( + Arguments.of("It should go to the first Song ", up1,up1.getPlaylist().get(0)) + ); + } + } \ No newline at end of file