Browse Source

UsbPlayerTest.getItemList Second Case

feature-pr-USB-otherTests
sahar 3 years ago
parent
commit
917cadd420
  1. 11
      src/test/java/device/usbPlayer/UsbPlayerTest.java

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

@ -567,7 +567,9 @@ class UsbPlayerTest {
void getItemListTest(String testName, UsbPlayer inputPlayer, String[] expectedResult) { void getItemListTest(String testName, UsbPlayer inputPlayer, String[] expectedResult) {
String[] Pl = inputPlayer.getItemList(); String[] Pl = inputPlayer.getItemList();
if (Pl.length > 0)
assertThat(Pl).contains("Musik 01.mp3", "Musik 02.mp3", "Musik 03.mp3").describedAs(testName); assertThat(Pl).contains("Musik 01.mp3", "Musik 02.mp3", "Musik 03.mp3").describedAs(testName);
else assertThat(Pl).describedAs("No Album").isEmpty();
} }
static Stream<Arguments> getItemList() { static Stream<Arguments> getItemList() {
@ -575,9 +577,14 @@ class UsbPlayerTest {
UsbPlayer up1 = new UsbPlayer(USBDrive); UsbPlayer up1 = new UsbPlayer(USBDrive);
String[] Pl = {"Musik 01.mp3", "Musik 02.mp3", "Musik 03.mp3"}; String[] Pl = {"Musik 01.mp3", "Musik 02.mp3", "Musik 03.mp3"};
return Stream.of(
Arguments.of("An Album was returned ", up1, Pl,1)
UsbPlayer up2 = new UsbPlayer(USBDrive);
ArrayList<String> Pl1 = new ArrayList<String>();
up2.setPlaylist(Pl1);
String[] l = new String[3];
return Stream.of(
Arguments.of("An Album was returned ", up1, Pl, 1),
Arguments.of("There is no Album to be returned ", up2, l, 2)
); );
} }
Loading…
Cancel
Save