From 3376c4c676218366dcd949ff3f64698ef969caf2 Mon Sep 17 00:00:00 2001 From: alpina0707 Date: Wed, 9 Feb 2022 20:02:39 +0100 Subject: [PATCH] first Test for changeRegion() --- .../java/device/radioPlayer/RadioPlayer.java | 3 ++ .../device/radioPlayer/RadioPlayerTest.java | 38 +++++++------------ 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/src/main/java/device/radioPlayer/RadioPlayer.java b/src/main/java/device/radioPlayer/RadioPlayer.java index ca8897d..61763ea 100644 --- a/src/main/java/device/radioPlayer/RadioPlayer.java +++ b/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() { diff --git a/src/test/java/device/radioPlayer/RadioPlayerTest.java b/src/test/java/device/radioPlayer/RadioPlayerTest.java index e7e2410..f192ae9 100644 --- a/src/test/java/device/radioPlayer/RadioPlayerTest.java +++ b/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 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() { }