From 692a519b762862809d2ee60739dbec4ad22c2e42 Mon Sep 17 00:00:00 2001 From: sahar Date: Sat, 12 Feb 2022 16:46:11 +0100 Subject: [PATCH] UsbPlayerTest.findSongTest first Case --- src/main/java/device/usbPlayer/UsbPlayer.java | 4 ++++ .../java/device/usbPlayer/UsbPlayerTest.java | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/main/java/device/usbPlayer/UsbPlayer.java b/src/main/java/device/usbPlayer/UsbPlayer.java index dadba47..4be2046 100644 --- a/src/main/java/device/usbPlayer/UsbPlayer.java +++ b/src/main/java/device/usbPlayer/UsbPlayer.java @@ -183,4 +183,8 @@ public class UsbPlayer implements Device { } + public int findSong(String song){ + return -1; + } + } diff --git a/src/test/java/device/usbPlayer/UsbPlayerTest.java b/src/test/java/device/usbPlayer/UsbPlayerTest.java index 03c5b2c..c285d79 100644 --- a/src/test/java/device/usbPlayer/UsbPlayerTest.java +++ b/src/test/java/device/usbPlayer/UsbPlayerTest.java @@ -190,4 +190,20 @@ void louderTest(String testName, UsbPlayer inputPlay, int expectedResult) { ); } + @ParameterizedTest + @MethodSource("FindSongOptions") + void findSongTest(String testName, UsbPlayer inputPlay, int expectedResult) { + int songLocation = inputPlay.findSong("song 4"); + assertThat(songLocation).describedAs(testName).isEqualTo(expectedResult); + } + + static Stream FindSongOptions() { + UsbPlayer up1 = new UsbPlayer(); + + return Stream.of( + Arguments.of("The song is not in the Album", up1, -1) + + ); + } + } \ No newline at end of file