Browse Source

added AssertJ test for "maximale Lautstärke"

feature-dev-rp_prev
alpina0707 3 years ago
parent
commit
69f5de9e8f
  1. 21
      src/test/java/device/RadioPlayerTest.java

21
src/test/java/device/RadioPlayerTest.java

@ -1,35 +1,26 @@
package device;
import org.junit.Before;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.*;
class RadioPlayerTest {
RadioPlayer rp = new RadioPlayer();
@Before
void setup()
{
rp.setLautstaerke(0);
}
@Test
void louder() {
rp.setLautstaerke(0);
rp.louder();
assertThat(rp.getLautstaerke()).isEqualTo(1);
}
@Before
void setup1()
{
rp.setLautstaerke(100);
}
@Test
void loudermax() {
void louderMax() {
rp.setLautstaerke(100);
rp.louder();
assertThat(rp.getLautstaerke()).isEqualTo(100);
}
/*
@Test

Loading…
Cancel
Save