diff --git a/src/test/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/ScenePriorityTests.java b/src/test/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/ScenePriorityTests.java index a01c5d5..574525c 100644 --- a/src/test/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/ScenePriorityTests.java +++ b/src/test/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/ScenePriorityTests.java @@ -1,6 +1,6 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut.models; -import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; @@ -39,4 +39,41 @@ public class ScenePriorityTests { assertEquals(20, scenePriority.getPriority()); } + + @Test + @DisplayName("get and set automation") + public void getAndSetAutomation() { + Automation a = new Automation(); + scenePriority.setAutomation(a); + + assertEquals(a, scenePriority.getAutomation()); + } + + @Test + @DisplayName("get and set scene") + public void getAndSetScene() { + Scene s = new Scene(); + scenePriority.setScene(s); + + assertEquals(s, scenePriority.getScene()); + } + + @Test + @DisplayName("get and set scene") + public void testRemove() { + Scene s = new Scene(); + scenePriority.setScene(s); + scenePriority.setSceneId(20L); + + Automation a = new Automation(); + scenePriority.setAutomation(a); + scenePriority.setAutomationId(20L); + + scenePriority.preRemove(); + + assertNull(scenePriority.getAutomation()); + assertNull(scenePriority.getAutomationId()); + assertNull(scenePriority.getScene()); + assertNull(scenePriority.getSceneId()); + } }