|
|
@ -9,6 +9,7 @@ import java.util.ArrayList; |
|
|
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat; |
|
|
|
|
|
|
|
|
|
|
|
class UsbPlayerTest { |
|
|
|
|
|
|
|
//UsbPlayer up = new UsbPlayer(); |
|
|
@ -542,12 +543,11 @@ class UsbPlayerTest { |
|
|
|
Arguments.of("The Sound is unmuted ", up1,"unmuted","Sound level has changed","previous sound level is 0") |
|
|
|
|
|
|
|
); |
|
|
|
}//chooseItem |
|
|
|
} |
|
|
|
|
|
|
|
@ParameterizedTest |
|
|
|
@MethodSource("chooseItem") |
|
|
|
void chooseItemTest(String testName, String inputSong, String expectedResult) { |
|
|
|
//int volumeNum = inputPlay.getLautstaerke(); |
|
|
|
assertThat(inputSong).describedAs(testName).isEqualTo(expectedResult); |
|
|
|
} |
|
|
|
|
|
|
@ -560,6 +560,25 @@ class UsbPlayerTest { |
|
|
|
Arguments.of("Incorrect Nr of Item was given < 0", up1.chooseItem(-1), "The Nr is smaller than 0"), |
|
|
|
Arguments.of("Incorrect Nr of Item was given > 0", up1.chooseItem(5), "The Nr is bigger than 0") |
|
|
|
); |
|
|
|
}//getItemList |
|
|
|
|
|
|
|
@ParameterizedTest |
|
|
|
@MethodSource("getItemList") |
|
|
|
void getItemListTest(String testName, UsbPlayer inputPlayer, String[] expectedResult) { |
|
|
|
String[] Pl = inputPlayer.getItemList(); |
|
|
|
|
|
|
|
assertThat(Pl).contains("Musik 01.mp3","Musik 02.mp3","Musik 03.mp3").describedAs(testName); |
|
|
|
} |
|
|
|
|
|
|
|
static Stream<Arguments> getItemList() { |
|
|
|
USB_Stick USBDrive = new USB_Stick(); |
|
|
|
UsbPlayer up1 = new UsbPlayer(USBDrive); |
|
|
|
String[] Pl = {"Musik 01.mp3","Musik 02.mp3","Musik 03.mp3"}; |
|
|
|
|
|
|
|
return Stream.of( |
|
|
|
Arguments.of("An Album was returned ", up1, Pl,1) |
|
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
} |