Browse Source

first Test for changeRegion()

feature-pr-changeRegion
Jan Ortner 3 years ago
parent
commit
3376c4c676
  1. 3
      src/main/java/device/radioPlayer/RadioPlayer.java
  2. 38
      src/test/java/device/radioPlayer/RadioPlayerTest.java

3
src/main/java/device/radioPlayer/RadioPlayer.java

@ -26,6 +26,9 @@ public class RadioPlayer implements Device {
return Lautstaerke;
}
public void changeRegion(){
}
@Override
public void louder() {

38
src/test/java/device/radioPlayer/RadioPlayerTest.java

@ -44,35 +44,25 @@ class RadioPlayerTest {
);
}
/*
@Test
void louder() {
rp.setLautstaerke(0);
rp.louder();
assertThat(rp.getLautstaerke()).isEqualTo(1);
@ParameterizedTest
@MethodSource("changeRegionOptions")
void changeFrequencyTest(String testName, RadioPlayer testRp, String expectedResult) {
String station = testRp.playTrack;
assertThat(station).describedAs(testName).isEqualTo(expectedResult);
}
@Test
void louderMax() {
rp.setLautstaerke(100);
rp.louder();
assertThat(rp.getLautstaerke()).isEqualTo(100);
}
static Stream<Arguments> changeRegionOptions() {
RadioPlayer rp1 = new RadioPlayer();
rp1.changeRegion();
@Test
void quieter() {
rp.setLautstaerke(1);
rp.quieter();
assertThat(rp.getLautstaerke()).isEqualTo(0);
}
@Test
void quieterMax() {
rp.setLautstaerke(0);
rp.quieter();
assertThat(rp.getLautstaerke()).isEqualTo(0);
return Stream.of(
Arguments.of("Test change Region to Bayern", rp1, "Antenne Bayern")
);
}
Jenkins config test
/*
@Test
void getVolume() {
}

Loading…
Cancel
Save