|
|
@ -367,14 +367,25 @@ class CDPlayerTest { |
|
|
|
@ParameterizedTest |
|
|
|
@MethodSource("changePlaySourceData") |
|
|
|
void changePlaySourceTest(String testName,String cases, CDPlayer _cdPlayer) { |
|
|
|
|
|
|
|
if(cases.equals("Case1")) { |
|
|
|
String returnVal = _cdPlayer.changePlaySource(); |
|
|
|
assertThat(returnVal).describedAs(testName).isEqualTo("CDWechseler"); |
|
|
|
} |
|
|
|
if(cases.equals("Case2")) { |
|
|
|
String returnVal = _cdPlayer.changePlaySource(); |
|
|
|
assertThat(returnVal).describedAs(testName).isEqualTo("CDDrive"); |
|
|
|
} |
|
|
|
} |
|
|
|
static Stream<Arguments> changePlaySourceData () { |
|
|
|
CDPlayer cdPlayer1 = new CDPlayer(); |
|
|
|
|
|
|
|
CDPlayer cdPlayer2 = new CDPlayer(); |
|
|
|
cdPlayer2.changePlaySource(); |
|
|
|
|
|
|
|
return Stream.of( |
|
|
|
Arguments.of("[changePlaySource() by activeSource=CDDrive ] => shouldReturnCDWechseler","Case1", cdPlayer1) |
|
|
|
Arguments.of("[changePlaySource() by activeSource=CDDrive ] => shouldReturnCDWechseler","Case1", cdPlayer1), |
|
|
|
Arguments.of("[changePlaySource() by activeSource=CDWechseler ] => shouldReturnCDDrive","Case2", cdPlayer2) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|