From 5a74e5ea751d9bc4888ce4122fa8cfce6a167f86 Mon Sep 17 00:00:00 2001 From: sahar Date: Sun, 13 Feb 2022 14:47:50 +0100 Subject: [PATCH] UsbPlayerTest.GoToTest Third Case --- src/main/java/device/usbPlayer/UsbPlayer.java | 2 +- src/test/java/device/usbPlayer/UsbPlayerTest.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/device/usbPlayer/UsbPlayer.java b/src/main/java/device/usbPlayer/UsbPlayer.java index 3c5d333..8e38ed0 100644 --- a/src/main/java/device/usbPlayer/UsbPlayer.java +++ b/src/main/java/device/usbPlayer/UsbPlayer.java @@ -203,7 +203,7 @@ public class UsbPlayer implements Device { public boolean GoTo(String songName){ if(findSong(songName) != -1){ - playTrack = songName; + playTrack = getPlaylist().get(findSong(songName));//songName; return true; } else diff --git a/src/test/java/device/usbPlayer/UsbPlayerTest.java b/src/test/java/device/usbPlayer/UsbPlayerTest.java index daa1900..20d83d5 100644 --- a/src/test/java/device/usbPlayer/UsbPlayerTest.java +++ b/src/test/java/device/usbPlayer/UsbPlayerTest.java @@ -226,9 +226,13 @@ void louderTest(String testName, UsbPlayer inputPlay, int expectedResult) { UsbPlayer up2 = new UsbPlayer(); up2.GoTo("Musik 04.mp3"); + UsbPlayer up3 = new UsbPlayer(); + up3.GoTo("Musik 02"); + return Stream.of( Arguments.of("Go to Song : Musik 03.mp3 ", up1, "Musik 03.mp3"), - Arguments.of("Go to Song that is not in the Album: Musik 04.mp3 ", up2, "Musik 01.mp3") + Arguments.of("Go to Song that is not in the Album: Musik 04.mp3 ", up2, "Musik 01.mp3"), + Arguments.of("Go to Song without writing the full Name : Musik 02 ", up3, "Musik 02.mp3") ); }