fixed tests

This commit is contained in:
Claudio Maggioni (maggicl) 2020-04-16 18:34:17 +02:00
parent cde88f2ca9
commit ff5dadd128
2 changed files with 5 additions and 3 deletions

View file

@ -3,6 +3,7 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut;
import static org.junit.jupiter.api.Assertions.*;
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.ButtonDimmer;
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.Dimmable;
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.DimmableLight;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
@ -38,7 +39,7 @@ public class ButtonDimmerTests {
@DisplayName(" increase the intensity ")
public void increase() {
buttonDimmer.increaseIntensity();
for (DimmableLight dl : buttonDimmer.getOutputs()) {
for (Dimmable dl : buttonDimmer.getOutputs()) {
assertTrue(dl.getIntensity() > 10);
}
}
@ -47,7 +48,7 @@ public class ButtonDimmerTests {
@DisplayName(" decrease the intensity ")
public void decrease() {
buttonDimmer.decreaseIntensity();
for (DimmableLight dl : buttonDimmer.getOutputs()) {
for (Dimmable dl : buttonDimmer.getOutputs()) {
assertTrue(dl.getIntensity() < 10);
}
}

View file

@ -2,6 +2,7 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut;
import static org.junit.jupiter.api.Assertions.*;
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.Dimmable;
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.DimmableLight;
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.KnobDimmer;
import org.junit.jupiter.api.BeforeEach;
@ -38,7 +39,7 @@ public class KnobDimmerTests {
@DisplayName(" set the intensity ")
public void increase() {
knobDimmer.setLightIntensity(30);
for (DimmableLight dl : knobDimmer.getOutputs()) {
for (Dimmable dl : knobDimmer.getOutputs()) {
assertEquals(30, dl.getIntensity());
}
}