From 3cd0fd22e440133513d84a4721d87d04111f8182 Mon Sep 17 00:00:00 2001 From: Bart Sopers Date: Mon, 26 Oct 2020 21:53:56 +0100 Subject: [PATCH] Add test --- .../plugins/pump/omnipod/driver/util/TimeUtilTest.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/omnipod/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/util/TimeUtilTest.java b/omnipod/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/util/TimeUtilTest.java index 49ee7c02ba..6165de683d 100644 --- a/omnipod/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/util/TimeUtilTest.java +++ b/omnipod/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/util/TimeUtilTest.java @@ -1,7 +1,5 @@ package info.nightscout.androidaps.plugins.pump.omnipod.driver.util; -import net.danlew.android.joda.JodaTimeAndroid; - import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import org.junit.Before; @@ -38,6 +36,13 @@ public class TimeUtilTest { assertEquals(83101, TimeUtil.toDuration(dateTime).getStandardSeconds()); } + @Test + public void testDateTimeInOtherZone() { + DateTime dateTime = new DateTime(2020, 3, 29, 23, 5, 1, DateTimeZone.forID("America/Los_Angeles")); + + assertEquals(83101, TimeUtil.toDuration(dateTime).getStandardSeconds()); + } + @Test public void testDateTimeToDurationWithNullDateTime() { IllegalArgumentException ex = assertThrows(IllegalArgumentException.class, () -> TimeUtil.toDuration(null));