From 95977c9ae7e675d8ba6a4433a8d8ace842c9f06e Mon Sep 17 00:00:00 2001 From: sahar Date: Wed, 16 Feb 2022 00:17:49 +0100 Subject: [PATCH] UsbPlayerTest.setPlayTrackTest first Case --- .../java/device/usbPlayer/UsbPlayerTest.java | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/test/java/device/usbPlayer/UsbPlayerTest.java b/src/test/java/device/usbPlayer/UsbPlayerTest.java index 1986521..b44afb5 100644 --- a/src/test/java/device/usbPlayer/UsbPlayerTest.java +++ b/src/test/java/device/usbPlayer/UsbPlayerTest.java @@ -358,10 +358,27 @@ class UsbPlayerTest { return Stream.of( - Arguments.of("It should go to the Last Song ", up1,up3.getPlaylist().get(up3.getPlaylist().size()-1)), - Arguments.of("It should go to the Last Song even after calling the function twice ", up2,up3.getPlaylist().get(up3.getPlaylist().size()-1)), + Arguments.of("It should go to the Last Song ", up1,up1.getPlaylist().get(up1.getPlaylist().size()-1)), + Arguments.of("It should go to the Last Song even after calling the function twice ", up2,up2.getPlaylist().get(up2.getPlaylist().size()-1)), Arguments.of("It should go to the Last Song even changing the current song ", up3,up3.getPlaylist().get(up3.getPlaylist().size()-1)) ); } + @ParameterizedTest + @MethodSource("setPlayTrackOptions") + void setPlayTrackTest(String testName, UsbPlayer inputUSB, String expectedResult) { + String firstSong = inputUSB.getPlayTrack(); + assertThat(firstSong ).describedAs(testName).isEqualTo(expectedResult); + } + + static Stream setPlayTrackOptions() { + //first case + UsbPlayer up1 = new UsbPlayer(); + up1.setPlayTrack("Musik 02.mp3"); + + return Stream.of( + Arguments.of("It should change the current Song ", up1,"Musik 02.mp3") + ); + } + } \ No newline at end of file