|
@ -77,6 +77,26 @@ class CDPlayerTest { |
|
|
cdPlayer9.tapOnCdFlap(); |
|
|
cdPlayer9.tapOnCdFlap(); |
|
|
cdPlayer9.setCD(audioCD3); |
|
|
cdPlayer9.setCD(audioCD3); |
|
|
cdPlayer9.tapOnCdFlap(); |
|
|
cdPlayer9.tapOnCdFlap(); |
|
|
|
|
|
|
|
|
|
|
|
CDPlayer cdPlayer10=new CDPlayer(); |
|
|
|
|
|
cdPlayer10.tapOnCdFlap(); |
|
|
|
|
|
cdPlayer10.setCD(audioCD4); |
|
|
|
|
|
cdPlayer10.tapOnCdFlap(); |
|
|
|
|
|
|
|
|
|
|
|
return Stream.of( |
|
|
|
|
|
Arguments.of("[CdFlap=isClosed , CdDriveContent=>isEmpty] => NoCD", cdPlayer1, new NoCDException(), "CD must be set."), |
|
|
|
|
|
Arguments.of("[CdFlap has been Opened and Closed, CdDriveContent=>isEmpty] => NoCD", cdPlayer2,new NoCDException(),"CD must be set."), |
|
|
|
|
|
Arguments.of("[CdFlap=isOpen , CdDriveContent=>isEmpty] => CdFlapIsOpen", cdPlayer3,new CdFlapIsOpenException(),"Cd Flap must be closed."), |
|
|
|
|
|
Arguments.of("[CdFlap=isOpen , CdDriveContent=>isSet] => CdFlapIsOpen", cdPlayer4,new CdFlapIsOpenException(),"Cd Flap must be closed."), |
|
|
|
|
|
Arguments.of("[CdFlap=isClosed , CdDriveContent=>isSet, CdFormat=>DVD] => FormatNotSupported",cdPlayer5,new FormatNotSupportedException(),"Cd-Format not supported."), |
|
|
|
|
|
Arguments.of("[CdFlap=isClosed , CdDriveContent=>isSet, CdFormat=>Blue-ray] => FormatNotSupported",cdPlayer6, new FormatNotSupportedException(),"Cd-Format not supported."), |
|
|
|
|
|
Arguments.of("[CdFlap=isClosed , CdDriveContent=>isSet, CdFormat=>Audio] => AllConditionsForPlayMet", cdPlayer7,null,"AllConditionsForPlayMet"), |
|
|
|
|
|
Arguments.of("[CdFlap=isClosed , CdDriveContent=>isSet, CdFormat=>MP3] => AllConditionsForPlayMet", cdPlayer8,null,"AllConditionsForPlayMet"), |
|
|
|
|
|
Arguments.of("[CdFlap=isClosed , CdDriveContent=>isSet, CdFormat=>WMA] => AllConditionsForPlayMet", cdPlayer9,null,"AllConditionsForPlayMet"), |
|
|
|
|
|
Arguments.of("[CdFlap=isClosed , CdDriveContent=>isSet, CdFormat=>AAC] => AllConditionsForPlayMet", cdPlayer10,null,"AllConditionsForPlayMet") |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ParameterizedTest |
|
|
@ParameterizedTest |
|
|
@MethodSource("louderTestData") |
|
|
@MethodSource("louderTestData") |
|
|
void louderTest(String testName,String testDirection, CDPlayer _cdPlayer,int anzClicks, int expectedResult) { |
|
|
void louderTest(String testName,String testDirection, CDPlayer _cdPlayer,int anzClicks, int expectedResult) { |
|
@ -92,11 +112,6 @@ class CDPlayerTest { |
|
|
assertThat(_cdPlayer.getVolume()).describedAs(testName).isNotEqualTo(expectedResult); |
|
|
assertThat(_cdPlayer.getVolume()).describedAs(testName).isNotEqualTo(expectedResult); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
CDPlayer cdPlayer10=new CDPlayer(); |
|
|
|
|
|
cdPlayer10.tapOnCdFlap(); |
|
|
|
|
|
cdPlayer10.setCD(audioCD4); |
|
|
|
|
|
cdPlayer10.tapOnCdFlap(); |
|
|
|
|
|
static Stream<Arguments> louderTestData () { |
|
|
static Stream<Arguments> louderTestData () { |
|
|
CDPlayer cdPlayer=new CDPlayer(); |
|
|
CDPlayer cdPlayer=new CDPlayer(); |
|
|
return Stream.of( |
|
|
return Stream.of( |
|
@ -106,18 +121,5 @@ class CDPlayerTest { |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return Stream.of( |
|
|
|
|
|
Arguments.of("[CdFlap=isClosed , CdDriveContent=>isEmpty] => NoCD", cdPlayer1, new NoCDException(), "CD must be set."), |
|
|
|
|
|
Arguments.of("[CdFlap has been Opened and Closed, CdDriveContent=>isEmpty] => NoCD", cdPlayer2,new NoCDException(),"CD must be set."), |
|
|
|
|
|
Arguments.of("[CdFlap=isOpen , CdDriveContent=>isEmpty] => CdFlapIsOpen", cdPlayer3,new CdFlapIsOpenException(),"Cd Flap must be closed."), |
|
|
|
|
|
Arguments.of("[CdFlap=isOpen , CdDriveContent=>isSet] => CdFlapIsOpen", cdPlayer4,new CdFlapIsOpenException(),"Cd Flap must be closed."), |
|
|
|
|
|
Arguments.of("[CdFlap=isClosed , CdDriveContent=>isSet, CdFormat=>DVD] => FormatNotSupported",cdPlayer5,new FormatNotSupportedException(),"Cd-Format not supported."), |
|
|
|
|
|
Arguments.of("[CdFlap=isClosed , CdDriveContent=>isSet, CdFormat=>Blue-ray] => FormatNotSupported",cdPlayer6, new FormatNotSupportedException(),"Cd-Format not supported."), |
|
|
|
|
|
Arguments.of("[CdFlap=isClosed , CdDriveContent=>isSet, CdFormat=>Audio] => AllConditionsForPlayMet", cdPlayer7,null,"AllConditionsForPlayMet"), |
|
|
|
|
|
Arguments.of("[CdFlap=isClosed , CdDriveContent=>isSet, CdFormat=>MP3] => AllConditionsForPlayMet", cdPlayer8,null,"AllConditionsForPlayMet"), |
|
|
|
|
|
Arguments.of("[CdFlap=isClosed , CdDriveContent=>isSet, CdFormat=>WMA] => AllConditionsForPlayMet", cdPlayer9,null,"AllConditionsForPlayMet"), |
|
|
|
|
|
Arguments.of("[CdFlap=isClosed , CdDriveContent=>isSet, CdFormat=>AAC] => AllConditionsForPlayMet", cdPlayer10,null,"AllConditionsForPlayMet") |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |