From e7972264ded1662689a3ef9cc043888de75abbc3 Mon Sep 17 00:00:00 2001 From: JPANZO Date: Tue, 15 Feb 2022 17:28:00 +0100 Subject: [PATCH] Revert "test+productive code for case:1 of method prev in CDPlayer created." This reverts commit b4583eece1c40995c3485dffb099c90992aa0f03. --- src/main/java/device/cdPlayer/CDPlayer.java | 2 -- .../java/device/cdPlayer/CDPlayerTest.java | 25 ------------------- 2 files changed, 27 deletions(-) diff --git a/src/main/java/device/cdPlayer/CDPlayer.java b/src/main/java/device/cdPlayer/CDPlayer.java index 7eea012..5a55a91 100644 --- a/src/main/java/device/cdPlayer/CDPlayer.java +++ b/src/main/java/device/cdPlayer/CDPlayer.java @@ -52,8 +52,6 @@ public class CDPlayer implements Device { @Override public void prev() { - List playList = Arrays.asList(loadedCD.getPlayList()); - this.actualPlayTrack=playList.get(playList.indexOf(actualPlayTrack) -1); } diff --git a/src/test/java/device/cdPlayer/CDPlayerTest.java b/src/test/java/device/cdPlayer/CDPlayerTest.java index 702a3af..17bb3c0 100644 --- a/src/test/java/device/cdPlayer/CDPlayerTest.java +++ b/src/test/java/device/cdPlayer/CDPlayerTest.java @@ -197,29 +197,4 @@ class CDPlayerTest { ); } - @ParameterizedTest - @MethodSource("prevTestData") - void prevTest(String testName,String testDirection, CDPlayer _cdPlayer,int anzClicks, String expectedResult){ - for (int i = 0; i < anzClicks; i++) { - _cdPlayer.prev(); - } - assertThat(_cdPlayer.getActualPlayTrack()).describedAs(testName).isEqualTo(expectedResult); - } - static Stream prevTestData () { - - String[] audioPlayList=new String[]{"Audio 01","Audio 02","Audio 03","Audio 04","Audio 05"}; - CD audioCD=new CD("Audio",audioPlayList); - - CDPlayer cdPlayer1=new CDPlayer(); - cdPlayer1.tapOnCdFlap(); - cdPlayer1.setCD(audioCD); - cdPlayer1.tapOnCdFlap(); - cdPlayer1.next();//1x nach Vorne - - return Stream.of( - Arguments.of("[getActualPlayTrack() after 1x prev() starting by firstSong] => FirstSongSelected","FirstSongSelected", cdPlayer1, 1, cdPlayer1.getSongByNumber(0)) - ); - - } - } \ No newline at end of file