|
|
@ -389,6 +389,22 @@ class CDPlayerTest { |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
@ParameterizedTest |
|
|
|
@MethodSource("loadCDWechselerData") |
|
|
|
void loadCDWechselerTest(String testName,String cases, CDPlayer _cdPlayer,List<CD>cdList,Exception exception) { |
|
|
|
Exception newException = assertThrows(exception.getClass(), () -> _cdPlayer.loadCDWechseler(cdList)); |
|
|
|
assertEquals(CDWechselerNotRunningException.class, newException.getClass()); |
|
|
|
} |
|
|
|
static Stream<Arguments> loadCDWechselerData () { |
|
|
|
CDPlayer cdPlayer1 = new CDPlayer(); |
|
|
|
String[] audioPlayList=new String[]{"Audio 01","Audio 02","Audio 03","Audio 04","Audio 05"}; |
|
|
|
CD audioCD1=new CD("Audio",audioPlayList); |
|
|
|
List<CD>CdList1=Arrays.asList(audioCD1); |
|
|
|
|
|
|
|
return Stream.of( |
|
|
|
Arguments.of("[loadCDWechseler() by notRunning=CDWechseler ] => shouldThrowAnException", "Case1", cdPlayer1,CdList1,new CDWechselerNotRunningException()) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |