@ -56,7 +56,10 @@ public class RadioPlayer implements Device {
@Override
public void prev() {
int currentIndex=Playlist.indexOf(playTrack);
int nextIndex=Playlist.size()-1;
if(currentIndex!=0){nextIndex=(currentIndex-1);}
playTrack=Playlist.get(nextIndex);
}
@ -47,12 +47,16 @@ class RadioPlayerTest {
int currentIndex=rp.Playlist.indexOf(rp.playTrack);
assertThat(rp.playTrack).isEqualTo(rp.Playlist.get((currentIndex)%rp.Playlist.size()));
/*
@Test
void prev() {
rp.prev();
void getInfoText() {