Skip to content

Commit 3317825

Browse files
committed
Add tests with UoM conversion
For `PersistenceThresholdFilter` add a test case that fails when using temperatures in °C and a threshold in Kelvin. The threshold should ignore the offset (0 °C = 273,15 K). Add another test with length to increase coverage. Signed-off-by: Christoph Gehrke <cgdev@duck.com>
1 parent b48e163 commit 3317825

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

bundles/org.openhab.core.persistence/src/test/java/org/openhab/core/persistence/filter/PersistenceThresholdFilterTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ private static Stream<Arguments> argumentProvider() {
102102
// quantity type, below threshold, absolute, with unit
103103
Arguments.of(new QuantityType<>("10 m"), new QuantityType<>("10.002 m"), "mm", false, false),
104104
// quantity type, above threshold, absolute, with unit
105+
Arguments.of(new QuantityType<>("1 ft"), new QuantityType<>("11 in"), "mm", false, true),
106+
// quantity type, below threshold, absolute, with unit
107+
Arguments.of(new QuantityType<>("0 °C"), new QuantityType<>("0 °C"), "K", false, false),
108+
// quantity type, above threshold, absolute, with unit
105109
Arguments.of(new QuantityType<>("-10 °C"), new QuantityType<>("5 °C"), "K", false, true));
106110
}
107111

0 commit comments

Comments
 (0)