@ -63,8 +60,8 @@ public class RadioPlayer implements Device {
String[]AntenneBYInfo={"ANTENNE BAYERN Guten Morgen Bayern","ANTENNE BAYERN bei der Arbeit","ANTENNE BAYERN am Nachmittag","ANTENNE BAYERN am Abend","ANTENNE BAYERN Hit-Nacht"};
publicvoidsetLautstaerke(intlautstaerke){
Lautstaerke=lautstaerke;
publicvoidsetVolume(intvolume){
this.volume=volume;
}
publicvoidchangeRegion(Stringregion){
@ -98,21 +95,21 @@ public class RadioPlayer implements Device {
@Override
publicvoidlouder(){
if(Lautstaerke<100){
Lautstaerke+=1;
}elseLautstaerke=100;
if(volume<100){
volume+=1;
}elsevolume=100;
}
@Override
publicvoidquieter(){
if(Lautstaerke>0){
Lautstaerke-=1;
}elseLautstaerke=0;
if(volume>0){
volume-=1;
}elsevolume=0;
}
@Override
publicintgetVolume(){
returnLautstaerke;
returnvolume;
}
@Override
@ -165,9 +162,8 @@ public class RadioPlayer implements Device {
Arguments.of("Test select station in saved playlist to play with nr isn`t bigger than playlist size",rp,"Teddy"),
Arguments.of("Test select station in saved playlist to play with nr is bigger than playlist size. Last station in playlist gets played",rp1,"MegaHits"),
@ -250,7 +232,6 @@ class RadioPlayerTest {
rp2.saveStation();
rp3.changeRegion("BY");
rp3.saveStation();
returnStream.of(
Arguments.of("Test for saving station in saved playlist",rp1,"normal","Antenne Bayern"),
Arguments.of("Test for not saving station which is already in saved playlist",rp2,"normal","MegaHits"),
@ -275,7 +256,6 @@ class RadioPlayerTest {
rp1.deleteStation();
rp1.deleteStation();
rp1.deleteStation();
returnStream.of(
Arguments.of("Test for delete station in saved playlist",rp,"delete",false),
Arguments.of("Test for not delete station in saved playlist if this is the last station",rp1,"noDelete",true)
@ -295,7 +275,6 @@ class RadioPlayerTest {
RadioPlayerrp1=newRadioPlayer();
rp1.changeRegion("BY");
rp1.changeToSavedPlaylist();
returnStream.of(
Arguments.of("Test for change to saved playlist when you already in saved playlist",rp,"YouFM"),
Arguments.of("Test for change to saved playlist when in regional playlist",rp1,"YouFM")
@ -319,7 +298,6 @@ class RadioPlayerTest {
RadioPlayerrp2=newRadioPlayer();
rp2.next();
rp2.changeOrderInSavedPlaylist(-1);
returnStream.of(
Arguments.of("Test for change order in saved playlist with nr isn`t bigger than playlist size",rp,0,"Teddy"),
Arguments.of("Test for change order in saved playlist with nr is than bigger playlist size put at the end of playlist",rp1,2,"YouFM"),
@ -342,7 +320,6 @@ class RadioPlayerTest {
RadioPlayerrp=newRadioPlayer();
RadioPlayerrp1=newRadioPlayer();
rp1.changeRegion("BY");
returnStream.of(
Arguments.of("Test for return saved playlist",rp,"saved",rp.savedPlaylist.toArray(newString[0])),
Arguments.of("Test for return regional playlist",rp1,"region",rp1.regionPlaylist.toArray(newString[0]))
@ -360,12 +337,11 @@ class RadioPlayerTest {
staticStream<Arguments>muteOptions(){
RadioPlayerrp=newRadioPlayer();
rp.setLautstaerke(25);
rp.setVolume(25);
rp.mute();
RadioPlayerrp1=newRadioPlayer();
rp1.setLautstaerke(30);
rp1.setVolume(30);
rp1.mute();
returnStream.of(
Arguments.of("Test for mute RadioPlayer if volume is actually 0","actual",rp,0),
Arguments.of("Test for mute RadioPlayer if volume is saved before muting","saved",rp1,30)
@ -375,7 +351,7 @@ class RadioPlayerTest {
@Test
voidtestUnmute(){
RadioPlayerrp=newRadioPlayer();
rp.setLautstaerke(40);
rp.setVolume(40);
rp.mute();
rp.unmute();
assertThat(rp.getVolume()).describedAs("Test if unmute is setting the saved volume").isEqualTo(rp.savedVolume);
@ -401,10 +377,8 @@ class RadioPlayerTest {
staticStream<Arguments>getInfoTextOptions(){
RadioPlayerrp=newRadioPlayer();
RadioPlayerrp1=newRadioPlayer();
RadioPlayerrp2=newRadioPlayer();
rp2.changeRegion("BY");
RadioPlayerrp3=newRadioPlayer();
RadioPlayerrp4=newRadioPlayer();
rp4.next();
RadioPlayerrp5=newRadioPlayer();
@ -414,12 +388,11 @@ class RadioPlayerTest {
rp6.changeRegion("BY");
RadioPlayerrp7=newRadioPlayer();
rp7.next();
returnStream.of(
Arguments.of("Test for getInfoText is not empty or null","null",rp,false),
Arguments.of("Test for getInfoText contains played station","station",rp1,true),
Arguments.of("Test for getInfoText contains played station","station",rp,true),
Arguments.of("Test for getInfoText contains regional playlist if played station is in it","region",rp2,true),
Arguments.of("Test for getInfoText contains saved playlist if played station is in it","saved",rp3,true),
Arguments.of("Test for getInfoText contains saved playlist if played station is in it","saved",rp,true),
Arguments.of("Test for getInfoText contains station number in saved playlist","savedNum",rp4,true),
Arguments.of("Test for getInfoText contains station number in regional playlist","regionNum",rp5,true),
Arguments.of("Test for getInfoText contains station info if station has one","stationInfo",rp6,true),
@ -444,7 +417,6 @@ class RadioPlayerTest {
staticStream<Arguments>getOptionsOptions(){
RadioPlayerrp=newRadioPlayer();
returnStream.of(
Arguments.of("returnValue of getOptions is not null","notNull",rp),
Arguments.of("should not return an empty array","arrayLengthGreater0",rp),