From 1a1aa35a5b598b6c5b607a5b45ef41e6dfaa5ea2 Mon Sep 17 00:00:00 2001 From: omenem Date: Tue, 26 May 2020 18:42:56 +0200 Subject: [PATCH] sensor --- .../sa4/sanmarinoes/smarthut/models/Sensor.java | 4 ---- .../sanmarinoes/smarthut/models/SensorTests.java | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Sensor.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Sensor.java index 7aee6c0..02c61d1 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Sensor.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Sensor.java @@ -87,10 +87,6 @@ public class Sensor extends InputDevice implements RangeTriggerable { this.typical = typical; } - public void setTypicalNull() { - this.typical = null; - } - public Sensor() { super("sensor"); } diff --git a/src/test/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/SensorTests.java b/src/test/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/SensorTests.java index 0aa1089..b747a9a 100644 --- a/src/test/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/SensorTests.java +++ b/src/test/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/SensorTests.java @@ -26,6 +26,22 @@ public class SensorTests { assertEquals(SensorType.LIGHT, sensor.getSensor()); } + @Test + @DisplayName("get and set err") + public void getAndSetError() { + sensor.setError(BigDecimal.valueOf(10)); + + assertEquals(BigDecimal.valueOf(10), sensor.getError()); + } + + @Test + @DisplayName("get and set typical") + public void getAndSetTypical() { + sensor.setTypical(BigDecimal.valueOf(10)); + + assertEquals(BigDecimal.valueOf(10), sensor.getTypical()); + } + @Test @DisplayName("get and set value") public void getAndSetValue() {