From d00dd96833904a9dfe5ed0f87940bb8567a30608 Mon Sep 17 00:00:00 2001 From: sahar Date: Sat, 12 Feb 2022 23:18:25 +0100 Subject: [PATCH] UsbPlayerTest.findSongTest Third Case --- src/main/java/device/usbPlayer/UsbPlayer.java | 2 +- src/test/java/device/usbPlayer/UsbPlayerTest.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/device/usbPlayer/UsbPlayer.java b/src/main/java/device/usbPlayer/UsbPlayer.java index 501c451..0f824c7 100644 --- a/src/main/java/device/usbPlayer/UsbPlayer.java +++ b/src/main/java/device/usbPlayer/UsbPlayer.java @@ -191,7 +191,7 @@ public class UsbPlayer implements Device { for (int j = 0; j < getPlaylist().size(); j++) { song = getPlaylist().get(j); - songIndex=song.indexOf(songName); + songIndex=song.toLowerCase().indexOf(songName.toLowerCase()); if (songIndex != -1) { index = j; diff --git a/src/test/java/device/usbPlayer/UsbPlayerTest.java b/src/test/java/device/usbPlayer/UsbPlayerTest.java index 5d979d8..cb6831c 100644 --- a/src/test/java/device/usbPlayer/UsbPlayerTest.java +++ b/src/test/java/device/usbPlayer/UsbPlayerTest.java @@ -206,7 +206,8 @@ void louderTest(String testName, UsbPlayer inputPlay, int expectedResult) { UsbPlayer up1 = new UsbPlayer(); return Stream.of( Arguments.of("The song is not in the Album", up1.findSong("song 4"), -1), - Arguments.of("The song is in the Album", up1.findSong("Musik 02"), 1) + Arguments.of("The song is in the Album", up1.findSong("Musik 02"), 1), + Arguments.of("Name of the Song is in lower case :", up1.findSong("musik 02"), 1) ); }