Browse Source

test+productive code for case:2 of method prev in CDPlayer created.

feature-pr-cdPlayerPrev
JPANZO 3 years ago
parent
commit
ffd65cc96f
  1. 19
      src/test/java/device/cdPlayer/CDPlayerTest.java

19
src/test/java/device/cdPlayer/CDPlayerTest.java

@ -200,8 +200,18 @@ class CDPlayerTest {
@ParameterizedTest @ParameterizedTest
@MethodSource("prevTestData") @MethodSource("prevTestData")
void prevTest(String testName,String testDirection, CDPlayer _cdPlayer,int anzClicks, String expectedResult){ void prevTest(String testName,String testDirection, CDPlayer _cdPlayer,int anzClicks, String expectedResult){
for (int i = 0; i <anzClicks; i++) {
_cdPlayer.prev();
if(testDirection.equals("StartingBySecondSong")) {
_cdPlayer.next();
for (int i = 0; i < anzClicks; i++) {
_cdPlayer.prev();
}
}
if(testDirection.equals("StartingByThirdSong")) {
_cdPlayer.next();
_cdPlayer.next();
for (int i = 0; i < anzClicks; i++) {
_cdPlayer.prev();
}
} }
assertThat(_cdPlayer.getActualPlayTrack()).describedAs(testName).isEqualTo(expectedResult); assertThat(_cdPlayer.getActualPlayTrack()).describedAs(testName).isEqualTo(expectedResult);
} }
@ -214,10 +224,11 @@ class CDPlayerTest {
cdPlayer1.tapOnCdFlap(); cdPlayer1.tapOnCdFlap();
cdPlayer1.setCD(audioCD); cdPlayer1.setCD(audioCD);
cdPlayer1.tapOnCdFlap(); cdPlayer1.tapOnCdFlap();
cdPlayer1.next();
return Stream.of( return Stream.of(
Arguments.of("[getActualPlayTrack() after 1x prev() starting by secondSong] => FirstSongSelected", "FirstSongSelected", cdPlayer1, 1, cdPlayer1.getSongByNumber(0))
Arguments.of("[getActualPlayTrack() after 1x prev() starting by secondSong] => FirstSongSelected", "StartingBySecondSong", cdPlayer1, 1, cdPlayer1.getSongByNumber(0)),
Arguments.of("[getActualPlayTrack() after 2x prev() starting by thirdSong] => FirstSongSelected", "StartingByThirdSong", cdPlayer1, 2, cdPlayer1.getSongByNumber(0))
); );
} }
} }
Loading…
Cancel
Save