|
|
@ -327,4 +327,17 @@ class CDPlayerTest { |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
@ParameterizedTest |
|
|
|
@MethodSource("chooseItemTestData") |
|
|
|
void chooseItemTest(String testName,String cases, CDPlayer _cdPlayer,Exception exception , String expectedResult) { |
|
|
|
Exception newException = assertThrows(exception.getClass(), () -> _cdPlayer.chooseItem(1)); |
|
|
|
assertEquals(ReturnValueNullException.class, newException.getClass()); |
|
|
|
} |
|
|
|
static Stream<Arguments> chooseItemTestData () { |
|
|
|
CDPlayer cdPlayer1 = new CDPlayer(); |
|
|
|
return Stream.of( |
|
|
|
Arguments.of("[chooseItem() by notSetCD ] => shouldThrowReturnValueNullException","Case1", cdPlayer1,new ReturnValueNullException(),"") |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
} |