Browse Source

UsbPlayerTest.isAllAudioTestTest Second Case (mp4)

feature.pr-USB-NewTest
sahar 3 years ago
parent
commit
3fa2cfb862
  1. 2
      src/main/java/device/usbPlayer/UsbPlayer.java
  2. 11
      src/test/java/device/usbPlayer/UsbPlayerTest.java

2
src/main/java/device/usbPlayer/UsbPlayer.java

@ -76,7 +76,7 @@ public class UsbPlayer implements Device {
for (int i = 0; i < Playlist.size(); i++) { for (int i = 0; i < Playlist.size(); i++) {
song = Playlist.get(i).substring(Playlist.get(i).length() - 4); song = Playlist.get(i).substring(Playlist.get(i).length() - 4);
if (song.equals(".mp3") ) {
if (song.equals(".mp3") | song.equals(".mp4") ) {
flag = true; flag = true;
} else { } else {
flag = false; flag = false;

11
src/test/java/device/usbPlayer/UsbPlayerTest.java

@ -251,10 +251,15 @@ void louderTest(String testName, UsbPlayer inputPlay, int expectedResult) {
static Stream<Arguments> isAllAudioOptions() { static Stream<Arguments> isAllAudioOptions() {
UsbPlayer up1 = new UsbPlayer(); UsbPlayer up1 = new UsbPlayer();
//up1.GoTo("Musik 03.mp3");
UsbPlayer up2=new UsbPlayer();
ArrayList<String> Pl = new ArrayList<String>();
Pl.add("Musik 01.mp4");
Pl.add("Musik 02.mp4");
Pl.add("Musik 03.mp4");
up2.setPlaylist(Pl);
return Stream.of( 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)
); );
} }

Loading…
Cancel
Save