fix
This commit is contained in:
parent
5946d0974e
commit
0ce6e84380
4 changed files with 17 additions and 17 deletions
|
@ -11,11 +11,11 @@ import org.junit.jupiter.api.Test;
|
||||||
@DisplayName("Dimmable State Tests")
|
@DisplayName("Dimmable State Tests")
|
||||||
public class DimmableStateTests {
|
public class DimmableStateTests {
|
||||||
|
|
||||||
private DimmableState<DimmableLight> dimmableState;
|
private DimmableState dimmableState;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void createDimmableState() {
|
public void createDimmableState() {
|
||||||
dimmableState = new DimmableState<>();
|
dimmableState = new DimmableState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -3,8 +3,8 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut;
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.DimmableLight;
|
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.DimmableLight;
|
||||||
|
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.Operator;
|
||||||
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.RangeCondition;
|
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.RangeCondition;
|
||||||
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.RangeCondition.Operator;
|
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.DisplayName;
|
import org.junit.jupiter.api.DisplayName;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
@ -22,9 +22,9 @@ public class RangeConditionTests {
|
||||||
@Test
|
@Test
|
||||||
@DisplayName("set and get operator")
|
@DisplayName("set and get operator")
|
||||||
public void setAndGetOperator() {
|
public void setAndGetOperator() {
|
||||||
rangeCondition.setOperator(RangeCondition.Operator.EQUAL);
|
rangeCondition.setOperator(Operator.EQUAL);
|
||||||
|
|
||||||
assertEquals(RangeCondition.Operator.EQUAL, rangeCondition.getOperator());
|
assertEquals(Operator.EQUAL, rangeCondition.getOperator());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -43,10 +43,10 @@ public class RangeConditionTests {
|
||||||
rangeCondition.setDevice(d);
|
rangeCondition.setDevice(d);
|
||||||
rangeCondition.setRange(45D);
|
rangeCondition.setRange(45D);
|
||||||
|
|
||||||
rangeCondition.setOperator(RangeCondition.Operator.EQUAL);
|
rangeCondition.setOperator(Operator.EQUAL);
|
||||||
assertFalse(rangeCondition.triggered());
|
assertFalse(rangeCondition.triggered());
|
||||||
|
|
||||||
rangeCondition.setOperator(RangeCondition.Operator.LESS);
|
rangeCondition.setOperator(Operator.LESS);
|
||||||
assertTrue(rangeCondition.triggered());
|
assertTrue(rangeCondition.triggered());
|
||||||
|
|
||||||
rangeCondition.setOperator(Operator.GREATER);
|
rangeCondition.setOperator(Operator.GREATER);
|
||||||
|
|
|
@ -5,6 +5,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.DimmableLight;
|
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.DimmableLight;
|
||||||
|
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.Operator;
|
||||||
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.RangeTrigger;
|
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.RangeTrigger;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.DisplayName;
|
import org.junit.jupiter.api.DisplayName;
|
||||||
|
@ -23,9 +24,9 @@ public class RangeTriggerTests {
|
||||||
@Test
|
@Test
|
||||||
@DisplayName("set and get operator")
|
@DisplayName("set and get operator")
|
||||||
public void setAndGetOperator() {
|
public void setAndGetOperator() {
|
||||||
rangeTrigger.setOperator(RangeTrigger.Operator.EQUAL);
|
rangeTrigger.setOperator(Operator.EQUAL);
|
||||||
|
|
||||||
assertEquals(RangeTrigger.Operator.EQUAL, rangeTrigger.getOperator());
|
assertEquals(Operator.EQUAL, rangeTrigger.getOperator());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -44,19 +45,19 @@ public class RangeTriggerTests {
|
||||||
rangeTrigger.setDevice(d);
|
rangeTrigger.setDevice(d);
|
||||||
rangeTrigger.setRange(45D);
|
rangeTrigger.setRange(45D);
|
||||||
|
|
||||||
rangeTrigger.setOperator(RangeTrigger.Operator.EQUAL);
|
rangeTrigger.setOperator(Operator.EQUAL);
|
||||||
assertFalse(rangeTrigger.triggered());
|
assertFalse(rangeTrigger.triggered());
|
||||||
|
|
||||||
rangeTrigger.setOperator(RangeTrigger.Operator.LESS);
|
rangeTrigger.setOperator(Operator.LESS);
|
||||||
assertTrue(rangeTrigger.triggered());
|
assertTrue(rangeTrigger.triggered());
|
||||||
|
|
||||||
rangeTrigger.setOperator(RangeTrigger.Operator.GREATER);
|
rangeTrigger.setOperator(Operator.GREATER);
|
||||||
assertFalse(rangeTrigger.triggered());
|
assertFalse(rangeTrigger.triggered());
|
||||||
|
|
||||||
rangeTrigger.setOperator(RangeTrigger.Operator.LESS_EQUAL);
|
rangeTrigger.setOperator(Operator.LESS_EQUAL);
|
||||||
assertTrue(rangeTrigger.triggered());
|
assertTrue(rangeTrigger.triggered());
|
||||||
|
|
||||||
rangeTrigger.setOperator(RangeTrigger.Operator.GREATER_EQUAL);
|
rangeTrigger.setOperator(Operator.GREATER_EQUAL);
|
||||||
assertFalse(rangeTrigger.triggered());
|
assertFalse(rangeTrigger.triggered());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.DimmableLight;
|
|
||||||
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.SwitchableState;
|
import ch.usi.inf.sa4.sanmarinoes.smarthut.models.SwitchableState;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.DisplayName;
|
import org.junit.jupiter.api.DisplayName;
|
||||||
|
@ -11,11 +10,11 @@ import org.junit.jupiter.api.Test;
|
||||||
@DisplayName("Switchable State Tests")
|
@DisplayName("Switchable State Tests")
|
||||||
public class SwitchableStateTests {
|
public class SwitchableStateTests {
|
||||||
|
|
||||||
private SwitchableState<DimmableLight> switchableState;
|
private SwitchableState switchableState;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void createSwitchableState() {
|
public void createSwitchableState() {
|
||||||
switchableState = new SwitchableState<>();
|
switchableState = new SwitchableState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in a new issue