From 3fa2cfb8627ffe073896a0cd888e7abaab3ec23f Mon Sep 17 00:00:00 2001 From: sahar Date: Tue, 15 Feb 2022 17:25:55 +0100 Subject: [PATCH] UsbPlayerTest.isAllAudioTestTest Second Case (mp4) --- src/main/java/device/usbPlayer/UsbPlayer.java | 2 +- src/test/java/device/usbPlayer/UsbPlayerTest.java | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/device/usbPlayer/UsbPlayer.java b/src/main/java/device/usbPlayer/UsbPlayer.java index 41189a4..1c18978 100644 --- a/src/main/java/device/usbPlayer/UsbPlayer.java +++ b/src/main/java/device/usbPlayer/UsbPlayer.java @@ -76,7 +76,7 @@ public class UsbPlayer implements Device { for (int i = 0; i < Playlist.size(); i++) { song = Playlist.get(i).substring(Playlist.get(i).length() - 4); - if (song.equals(".mp3") ) { + if (song.equals(".mp3") | song.equals(".mp4") ) { flag = true; } else { flag = false; diff --git a/src/test/java/device/usbPlayer/UsbPlayerTest.java b/src/test/java/device/usbPlayer/UsbPlayerTest.java index 5f09063..37acd4a 100644 --- a/src/test/java/device/usbPlayer/UsbPlayerTest.java +++ b/src/test/java/device/usbPlayer/UsbPlayerTest.java @@ -251,10 +251,15 @@ void louderTest(String testName, UsbPlayer inputPlay, int expectedResult) { static Stream isAllAudioOptions() { UsbPlayer up1 = new UsbPlayer(); - //up1.GoTo("Musik 03.mp3"); - + UsbPlayer up2=new UsbPlayer(); + ArrayList Pl = new ArrayList(); + Pl.add("Musik 01.mp4"); + Pl.add("Musik 02.mp4"); + Pl.add("Musik 03.mp4"); + up2.setPlaylist(Pl); return Stream.of( - Arguments.of("Go to Song : Musik 03.mp3 ", up1.isAllAudio(), true) + Arguments.of("Go to Song : Musik 03.mp3 ", up1.isAllAudio(), true), + Arguments.of("Go to Song : Musik 03.mp3 ", up2.isAllAudio(), true) ); }