Browse Source

UsbPlayerTest.isAllAudioTestTest Forth Case correction(wav)

feature.pr-USB-NewTest
sahar 3 years ago
parent
commit
0188a43e11
  1. 2
      src/main/java/device/usbPlayer/UsbPlayer.java
  2. 12
      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") | song.equals(".mp4")| song.equals(".m4a") ) {
if (song.equals(".mp3") | song.equals(".mp4")| song.equals(".m4a")| song.equals(".wav") ) {
flag = true; flag = true;
} else { } else {
flag = false; flag = false;

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

@ -267,19 +267,19 @@ class UsbPlayerTest {
Pl1.add("Musik 01.m4a"); Pl1.add("Musik 01.m4a");
Pl1.add("Musik 02.m4a"); Pl1.add("Musik 02.m4a");
Pl1.add("Musik 03.m4a"); Pl1.add("Musik 03.m4a");
up3.setPlaylist(Pl);
up3.setPlaylist(Pl1);
//Flac //Flac
UsbPlayer up4 = new UsbPlayer(); UsbPlayer up4 = new UsbPlayer();
ArrayList<String> Pl2 = new ArrayList<String>(); ArrayList<String> Pl2 = new ArrayList<String>();
Pl2.add("Musik 01.flac");
Pl2.add("Musik 02.flac");
Pl2.add("Musik 03.flac");
up4.setPlaylist(Pl);
Pl2.add("Musik 01.wav");
Pl2.add("Musik 02.wav");
Pl2.add("Musik 03.wav");
up4.setPlaylist(Pl2);
return Stream.of( return Stream.of(
Arguments.of("Check if the Files are .mp3 ", up1.isAllAudio(), true), Arguments.of("Check if the Files are .mp3 ", up1.isAllAudio(), true),
Arguments.of("Check if the Files are .mp4 ", up2.isAllAudio(), true), Arguments.of("Check if the Files are .mp4 ", up2.isAllAudio(), true),
Arguments.of("Check if the Files are .m4a ", up3.isAllAudio(), true), Arguments.of("Check if the Files are .m4a ", up3.isAllAudio(), true),
Arguments.of("Check if the Files are .flac ", up4.isAllAudio(), true)
Arguments.of("Check if the Files are .wav ", up4.isAllAudio(), true)
); );
} }

Loading…
Cancel
Save