Properly ignore PodSessionState test cases

This commit is contained in:
Bart Sopers 2020-05-04 23:52:44 +02:00
parent d8eb777b4c
commit 1bdc474b51

View file

@ -5,37 +5,20 @@ import org.joda.time.DateTimeUtils;
import org.joda.time.DateTimeZone;
import org.joda.time.Duration;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import dagger.android.HasAndroidInjector;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.pump.omnipod.defs.FirmwareVersion;
import info.nightscout.androidaps.utils.SP;
import static org.junit.Assert.assertEquals;
@Ignore("Not Dagger compliant")
@RunWith(PowerMockRunner.class)
@PrepareForTest({MainApp.class, SP.class, L.class})
public class PodSessionStateTest {
// @Before
// public void setup() {
//// AAPSMocker.mockMainApp();
//// AAPSMocker.mockApplicationContext();
//// AAPSMocker.mockSP();
// }
@Mock HasAndroidInjector hasAndroidInjector;
//@Test
@Test
@Ignore("Not Dagger compliant") // FIXME
public void times() {
DateTimeZone timeZone = DateTimeZone.UTC;
DateTimeZone.setDefault(timeZone);
@ -54,7 +37,8 @@ public class PodSessionStateTest {
assertEquals(Duration.standardHours(1).plus(Duration.standardMinutes(2).plus(Duration.standardSeconds(3))), podSessionState.getScheduleOffset());
}
//@Test
@Test
@Ignore("Not Dagger compliant") // FIXME
public void changeSystemTimeZoneWithoutChangingPodTimeZone() {
DateTimeZone timeZone = DateTimeZone.UTC;
DateTimeZone.setDefault(timeZone);
@ -78,7 +62,8 @@ public class PodSessionStateTest {
assertEquals(Duration.standardHours(1).plus(Duration.standardMinutes(2).plus(Duration.standardSeconds(3))), podSessionState.getScheduleOffset());
}
//@Test
@Test
@Ignore("Not Dagger compliant") // FIXME
public void changeSystemTimeZoneAndChangePodTimeZone() {
DateTimeZone timeZone = DateTimeZone.UTC;
DateTimeZone.setDefault(timeZone);
@ -103,8 +88,8 @@ public class PodSessionStateTest {
assertEquals(Duration.standardHours(3).plus(Duration.standardMinutes(2).plus(Duration.standardSeconds(3))), podSessionState.getScheduleOffset());
}
// @After
// public void tearDown() {
// DateTimeUtils.setCurrentMillisSystem();
// }
@After
public void tearDown() {
DateTimeUtils.setCurrentMillisSystem();
}
}