diff --git a/src/test/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/ThermostatTests.java b/src/test/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/ThermostatTests.java index e189131..30a23ea 100644 --- a/src/test/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/ThermostatTests.java +++ b/src/test/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/ThermostatTests.java @@ -2,6 +2,7 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut.models; import static org.junit.jupiter.api.Assertions.*; +import ch.usi.inf.sa4.sanmarinoes.smarthut.models.Thermostat.Mode; import java.math.BigDecimal; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; @@ -85,12 +86,34 @@ public class ThermostatTests { assertEquals(new BigDecimal(42), thermostat.getInternalSensorTemperature()); } + @Test + @DisplayName("test err ") + public void errTest() { + thermostat.setErr(BigDecimal.valueOf(10)); + assertEquals(BigDecimal.valueOf(10), thermostat.getErr()); + } + + @Test + @DisplayName("test typical ") + public void typicalTest() { + thermostat.setTypical(BigDecimal.valueOf(10)); + assertEquals(BigDecimal.valueOf(10), thermostat.getTypical()); + } + @Test @DisplayName("test triggerState") public void testTriggerState() { assertFalse(thermostat.readTriggerState()); } + @Test + @DisplayName("test triggerState") + public void testTriggerStateTrue() { + thermostat.setMode(Mode.COOLING); + + assertTrue(thermostat.readTriggerState()); + } + // for obvious reasons I am not gonna check all the possible combinations of toString() @Test @DisplayName("test to string")