diff --git a/src/main/java/device/cdPlayer/CDPlayer.java b/src/main/java/device/cdPlayer/CDPlayer.java index ff1caf2..8ef629f 100644 --- a/src/main/java/device/cdPlayer/CDPlayer.java +++ b/src/main/java/device/cdPlayer/CDPlayer.java @@ -44,8 +44,9 @@ public class CDPlayer implements Device { public void next() { List playList = Arrays.asList(loadedCD.getPlayList()); int indexOfActualPlayTrack=playList.indexOf(actualPlayTrack); - + System.out.println("indexOfActualPlayTrack="+indexOfActualPlayTrack); this.actualPlayTrack=playList.get(indexOfActualPlayTrack +1); + System.out.println("nextSong= "+actualPlayTrack); } @Override diff --git a/src/test/java/device/cdPlayer/CDPlayerTest.java b/src/test/java/device/cdPlayer/CDPlayerTest.java index 694460a..a3054e9 100644 --- a/src/test/java/device/cdPlayer/CDPlayerTest.java +++ b/src/test/java/device/cdPlayer/CDPlayerTest.java @@ -159,9 +159,9 @@ class CDPlayerTest { for (int i = 0; i < anzClicks; i++) { _cdPlayer.next(); } - if(testDirection.equals("SecondSongSelected")){ + //if(testDirection.equals("SecondSongSelected")){ assertThat(_cdPlayer.getActualPlayTrack()).describedAs(testName).isEqualTo(expectedResult); - } + //} } static Stream nextTestData () { @@ -172,9 +172,11 @@ class CDPlayerTest { cdPlayer.tapOnCdFlap(); cdPlayer.setCD(audioCD); cdPlayer.tapOnCdFlap(); + System.out.println(cdPlayer.getActualPlayTrack()); return Stream.of( - Arguments.of("[getActualPlayTrack() after 1x next() starting by firstSong] => SecondSongSelected","SecondSongSelected", cdPlayer, 1, cdPlayer.getSongByNumber(1)) + Arguments.of("[getActualPlayTrack() after 1x next() starting by firstSong] => SecondSongSelected","SecondSongSelected", cdPlayer, 1, cdPlayer.getSongByNumber(1)), + Arguments.of("[getActualPlayTrack() after 2x next() starting by firstSong] => ThirdSongSelected","ThirdSongSelected" ,cdPlayer,1,cdPlayer.getSongByNumber(2)) ); }