This commit is contained in:
Bart Sopers 2020-10-26 21:53:56 +01:00
parent 6c879d6bba
commit 3cd0fd22e4

View file

@ -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));