Add test
This commit is contained in:
parent
6c879d6bba
commit
3cd0fd22e4
1 changed files with 7 additions and 2 deletions
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue