Thermostat
This commit is contained in:
parent
3e2eb231a0
commit
e12163d2eb
1 changed files with 23 additions and 0 deletions
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue