parent
3d384c7db5
commit
29113520c2
1 changed files with 105 additions and 105 deletions
|
@ -1,14 +1,14 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.podinfo;
|
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.podinfo;
|
||||||
|
|
||||||
import org.joda.time.Duration;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
import org.junit.jupiter.api.Assertions;
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.DeliveryStatus;
|
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.DeliveryStatus;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.ErrorEventInfo;
|
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.ErrorEventInfo;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.FaultEventCode;
|
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.FaultEventCode;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus;
|
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus;
|
||||||
import info.nightscout.pump.core.utils.ByteUtil;
|
import info.nightscout.pump.core.utils.ByteUtil;
|
||||||
|
import org.joda.time.Duration;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @noinspection SpellCheckingInspection
|
* @noinspection SpellCheckingInspection
|
||||||
|
@ -18,143 +18,143 @@ class PodInfoDetailedStatusTest {
|
||||||
void testPodInfoFaultEventNoFaultAlerts() {
|
void testPodInfoFaultEventNoFaultAlerts() {
|
||||||
PodInfoDetailedStatus podInfoDetailedStatus = new PodInfoDetailedStatus(ByteUtil.fromHexString("02080100000a003800000003ff008700000095ff0000"));
|
PodInfoDetailedStatus podInfoDetailedStatus = new PodInfoDetailedStatus(ByteUtil.fromHexString("02080100000a003800000003ff008700000095ff0000"));
|
||||||
|
|
||||||
Assertions.assertEquals(PodProgressStatus.ABOVE_FIFTY_UNITS, podInfoDetailedStatus.getPodProgressStatus());
|
assertThat(podInfoDetailedStatus.getPodProgressStatus()).isEqualTo(PodProgressStatus.ABOVE_FIFTY_UNITS);
|
||||||
Assertions.assertEquals(DeliveryStatus.NORMAL, podInfoDetailedStatus.getDeliveryStatus());
|
assertThat(podInfoDetailedStatus.getDeliveryStatus()).isEqualTo(DeliveryStatus.NORMAL);
|
||||||
Assertions.assertEquals(0, podInfoDetailedStatus.getBolusNotDelivered(), 0.000001);
|
assertThat(podInfoDetailedStatus.getBolusNotDelivered()).isWithin(0.000001).of(0);
|
||||||
Assertions.assertEquals(0x0a, podInfoDetailedStatus.getPodMessageCounter());
|
assertThat(podInfoDetailedStatus.getPodMessageCounter()).isEqualTo(0x0a);
|
||||||
Assertions.assertNull(podInfoDetailedStatus.getFaultEventCode());
|
assertThat(podInfoDetailedStatus.getFaultEventCode()).isNull();
|
||||||
Assertions.assertTrue(Duration.ZERO.isEqual(podInfoDetailedStatus.getFaultEventTime()));
|
assertThat(podInfoDetailedStatus.getFaultEventTime()).isEqualTo(Duration.ZERO);
|
||||||
Assertions.assertNull(podInfoDetailedStatus.getReservoirLevel());
|
assertThat(podInfoDetailedStatus.getReservoirLevel()).isNull();
|
||||||
Assertions.assertTrue(Duration.standardSeconds(8100).isEqual(podInfoDetailedStatus.getTimeActive()));
|
assertThat(podInfoDetailedStatus.getTimeActive()).isEqualTo(Duration.standardSeconds(8100));
|
||||||
Assertions.assertEquals(0, podInfoDetailedStatus.getUnacknowledgedAlerts().getRawValue());
|
assertThat(podInfoDetailedStatus.getUnacknowledgedAlerts().getRawValue()).isEqualTo(0);
|
||||||
Assertions.assertFalse(podInfoDetailedStatus.isFaultAccessingTables());
|
assertThat(podInfoDetailedStatus.isFaultAccessingTables()).isFalse();
|
||||||
ErrorEventInfo errorEventInfo = podInfoDetailedStatus.getErrorEventInfo();
|
ErrorEventInfo errorEventInfo = podInfoDetailedStatus.getErrorEventInfo();
|
||||||
Assertions.assertNull(errorEventInfo);
|
assertThat(errorEventInfo).isNull();
|
||||||
Assertions.assertNull(podInfoDetailedStatus.getPreviousPodProgressStatus());
|
assertThat(podInfoDetailedStatus.getPreviousPodProgressStatus()).isNull();
|
||||||
Assertions.assertEquals(2, podInfoDetailedStatus.getReceiverLowGain());
|
assertThat(podInfoDetailedStatus.getReceiverLowGain()).isEqualTo(2);
|
||||||
Assertions.assertEquals(21, podInfoDetailedStatus.getRadioRSSI());
|
assertThat(podInfoDetailedStatus.getRadioRSSI()).isEqualTo(21);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testPodInfoFaultEventDeliveryErrorDuringPriming() {
|
void testPodInfoFaultEventDeliveryErrorDuringPriming() {
|
||||||
PodInfoDetailedStatus podInfoDetailedStatus = new PodInfoDetailedStatus(ByteUtil.fromHexString("020f0000000900345c000103ff0001000005ae056029"));
|
PodInfoDetailedStatus podInfoDetailedStatus = new PodInfoDetailedStatus(ByteUtil.fromHexString("020f0000000900345c000103ff0001000005ae056029"));
|
||||||
|
|
||||||
Assertions.assertEquals(PodProgressStatus.INACTIVE, podInfoDetailedStatus.getPodProgressStatus());
|
assertThat(podInfoDetailedStatus.getPodProgressStatus()).isEqualTo(PodProgressStatus.INACTIVE);
|
||||||
Assertions.assertEquals(DeliveryStatus.SUSPENDED, podInfoDetailedStatus.getDeliveryStatus());
|
assertThat(podInfoDetailedStatus.getDeliveryStatus()).isEqualTo(DeliveryStatus.SUSPENDED);
|
||||||
Assertions.assertEquals(0, podInfoDetailedStatus.getBolusNotDelivered(), 0.000001);
|
assertThat(podInfoDetailedStatus.getBolusNotDelivered()).isWithin(0.000001).of(0);
|
||||||
Assertions.assertEquals(0x09, podInfoDetailedStatus.getPodMessageCounter());
|
assertThat(podInfoDetailedStatus.getPodMessageCounter()).isEqualTo(0x09);
|
||||||
Assertions.assertEquals(FaultEventCode.PRIME_OPEN_COUNT_TOO_LOW, podInfoDetailedStatus.getFaultEventCode());
|
assertThat(podInfoDetailedStatus.getFaultEventCode()).isEqualTo(FaultEventCode.PRIME_OPEN_COUNT_TOO_LOW);
|
||||||
Assertions.assertTrue(Duration.standardSeconds(60).isEqual(podInfoDetailedStatus.getFaultEventTime()));
|
assertThat(podInfoDetailedStatus.getFaultEventTime()).isEqualTo(Duration.standardSeconds(60));
|
||||||
Assertions.assertNull(podInfoDetailedStatus.getReservoirLevel());
|
assertThat(podInfoDetailedStatus.getReservoirLevel()).isNull();
|
||||||
Assertions.assertTrue(Duration.standardSeconds(60).isEqual(podInfoDetailedStatus.getTimeActive()));
|
assertThat(podInfoDetailedStatus.getTimeActive()).isEqualTo(Duration.standardSeconds(60));
|
||||||
Assertions.assertEquals(0, podInfoDetailedStatus.getUnacknowledgedAlerts().getRawValue());
|
assertThat(podInfoDetailedStatus.getUnacknowledgedAlerts().getRawValue()).isEqualTo(0);
|
||||||
Assertions.assertFalse(podInfoDetailedStatus.isFaultAccessingTables());
|
assertThat(podInfoDetailedStatus.isFaultAccessingTables()).isFalse();
|
||||||
ErrorEventInfo errorEventInfo = podInfoDetailedStatus.getErrorEventInfo();
|
ErrorEventInfo errorEventInfo = podInfoDetailedStatus.getErrorEventInfo();
|
||||||
Assertions.assertFalse(errorEventInfo.isInsulinStateTableCorruption());
|
assertThat(errorEventInfo.isInsulinStateTableCorruption()).isFalse();
|
||||||
Assertions.assertEquals(0x00, errorEventInfo.getInternalVariable());
|
assertThat(errorEventInfo.getInternalVariable()).isEqualTo(0x00);
|
||||||
Assertions.assertFalse(errorEventInfo.isImmediateBolusInProgress());
|
assertThat(errorEventInfo.isImmediateBolusInProgress()).isFalse();
|
||||||
Assertions.assertEquals(PodProgressStatus.PRIMING_COMPLETED, errorEventInfo.getPodProgressStatus());
|
assertThat(errorEventInfo.getPodProgressStatus()).isEqualTo(PodProgressStatus.PRIMING_COMPLETED);
|
||||||
Assertions.assertEquals(PodProgressStatus.PRIMING_COMPLETED, podInfoDetailedStatus.getPreviousPodProgressStatus());
|
assertThat(podInfoDetailedStatus.getPreviousPodProgressStatus()).isEqualTo(PodProgressStatus.PRIMING_COMPLETED);
|
||||||
Assertions.assertEquals(2, podInfoDetailedStatus.getReceiverLowGain());
|
assertThat(podInfoDetailedStatus.getReceiverLowGain()).isEqualTo(2);
|
||||||
Assertions.assertEquals(46, podInfoDetailedStatus.getRadioRSSI());
|
assertThat(podInfoDetailedStatus.getRadioRSSI()).isEqualTo(46);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testPodInfoFaultEventErrorShuttingDown() {
|
void testPodInfoFaultEventErrorShuttingDown() {
|
||||||
PodInfoDetailedStatus podInfoDetailedStatus = new PodInfoDetailedStatus(ByteUtil.fromHexString("020d0000000407f28609ff03ff0a0200000823080000"));
|
PodInfoDetailedStatus podInfoDetailedStatus = new PodInfoDetailedStatus(ByteUtil.fromHexString("020d0000000407f28609ff03ff0a0200000823080000"));
|
||||||
|
|
||||||
Assertions.assertEquals(PodProgressStatus.FAULT_EVENT_OCCURRED, podInfoDetailedStatus.getPodProgressStatus());
|
assertThat(podInfoDetailedStatus.getPodProgressStatus()).isEqualTo(PodProgressStatus.FAULT_EVENT_OCCURRED);
|
||||||
Assertions.assertEquals(DeliveryStatus.SUSPENDED, podInfoDetailedStatus.getDeliveryStatus());
|
assertThat(podInfoDetailedStatus.getDeliveryStatus()).isEqualTo(DeliveryStatus.SUSPENDED);
|
||||||
Assertions.assertEquals(2034, podInfoDetailedStatus.getTicksDelivered());
|
assertThat(podInfoDetailedStatus.getTicksDelivered()).isEqualTo(2034);
|
||||||
Assertions.assertEquals(101.7, podInfoDetailedStatus.getInsulinDelivered(), 0.000001);
|
assertThat(podInfoDetailedStatus.getInsulinDelivered()).isWithin(0.000001).of(101.7);
|
||||||
Assertions.assertEquals(0, podInfoDetailedStatus.getBolusNotDelivered(), 0.000001);
|
assertThat(podInfoDetailedStatus.getBolusNotDelivered()).isWithin(0.000001).of(0);
|
||||||
Assertions.assertEquals(0x04, podInfoDetailedStatus.getPodMessageCounter());
|
assertThat(podInfoDetailedStatus.getPodMessageCounter()).isEqualTo(0x04);
|
||||||
Assertions.assertEquals(FaultEventCode.BASAL_OVER_INFUSION_PULSE, podInfoDetailedStatus.getFaultEventCode());
|
assertThat(podInfoDetailedStatus.getFaultEventCode()).isEqualTo(FaultEventCode.BASAL_OVER_INFUSION_PULSE);
|
||||||
Assertions.assertTrue(Duration.standardMinutes(2559).isEqual(podInfoDetailedStatus.getFaultEventTime()));
|
assertThat(podInfoDetailedStatus.getFaultEventTime()).isEqualTo(Duration.standardMinutes(2559));
|
||||||
Assertions.assertNull(podInfoDetailedStatus.getReservoirLevel());
|
assertThat(podInfoDetailedStatus.getReservoirLevel()).isNull();
|
||||||
Assertions.assertEquals(0, podInfoDetailedStatus.getUnacknowledgedAlerts().getRawValue());
|
assertThat(podInfoDetailedStatus.getUnacknowledgedAlerts().getRawValue()).isEqualTo(0);
|
||||||
Assertions.assertFalse(podInfoDetailedStatus.isFaultAccessingTables());
|
assertThat(podInfoDetailedStatus.isFaultAccessingTables()).isFalse();
|
||||||
ErrorEventInfo errorEventInfo = podInfoDetailedStatus.getErrorEventInfo();
|
ErrorEventInfo errorEventInfo = podInfoDetailedStatus.getErrorEventInfo();
|
||||||
Assertions.assertFalse(errorEventInfo.isInsulinStateTableCorruption());
|
assertThat(errorEventInfo.isInsulinStateTableCorruption()).isFalse();
|
||||||
Assertions.assertEquals(0x00, errorEventInfo.getInternalVariable());
|
assertThat(errorEventInfo.getInternalVariable()).isEqualTo(0x00);
|
||||||
Assertions.assertFalse(errorEventInfo.isImmediateBolusInProgress());
|
assertThat(errorEventInfo.isImmediateBolusInProgress()).isFalse();
|
||||||
Assertions.assertEquals(PodProgressStatus.ABOVE_FIFTY_UNITS, errorEventInfo.getPodProgressStatus());
|
assertThat(errorEventInfo.getPodProgressStatus()).isEqualTo(PodProgressStatus.ABOVE_FIFTY_UNITS);
|
||||||
Assertions.assertEquals(PodProgressStatus.ABOVE_FIFTY_UNITS, podInfoDetailedStatus.getPreviousPodProgressStatus());
|
assertThat(podInfoDetailedStatus.getPreviousPodProgressStatus()).isEqualTo(PodProgressStatus.ABOVE_FIFTY_UNITS);
|
||||||
Assertions.assertEquals(0, podInfoDetailedStatus.getReceiverLowGain());
|
assertThat(podInfoDetailedStatus.getReceiverLowGain()).isEqualTo(0);
|
||||||
Assertions.assertEquals(35, podInfoDetailedStatus.getRadioRSSI());
|
assertThat(podInfoDetailedStatus.getRadioRSSI()).isEqualTo(35);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testPodInfoFaultEventInsulinNotDelivered() {
|
void testPodInfoFaultEventInsulinNotDelivered() {
|
||||||
PodInfoDetailedStatus podInfoDetailedStatus = new PodInfoDetailedStatus(ByteUtil.fromHexString("020f0000010200ec6a026803ff026b000028a7082023"));
|
PodInfoDetailedStatus podInfoDetailedStatus = new PodInfoDetailedStatus(ByteUtil.fromHexString("020f0000010200ec6a026803ff026b000028a7082023"));
|
||||||
|
|
||||||
Assertions.assertEquals(PodProgressStatus.INACTIVE, podInfoDetailedStatus.getPodProgressStatus());
|
assertThat(podInfoDetailedStatus.getPodProgressStatus()).isEqualTo(PodProgressStatus.INACTIVE);
|
||||||
Assertions.assertEquals(DeliveryStatus.SUSPENDED, podInfoDetailedStatus.getDeliveryStatus());
|
assertThat(podInfoDetailedStatus.getDeliveryStatus()).isEqualTo(DeliveryStatus.SUSPENDED);
|
||||||
Assertions.assertEquals(236, podInfoDetailedStatus.getTicksDelivered());
|
assertThat(podInfoDetailedStatus.getTicksDelivered()).isEqualTo(236);
|
||||||
Assertions.assertEquals(11.8, podInfoDetailedStatus.getInsulinDelivered(), 0.000001);
|
assertThat(podInfoDetailedStatus.getInsulinDelivered()).isWithin(0.000001).of(11.8);
|
||||||
Assertions.assertEquals(0.05, podInfoDetailedStatus.getBolusNotDelivered(), 0.000001);
|
assertThat(podInfoDetailedStatus.getBolusNotDelivered()).isWithin(0.000001).of(0.05);
|
||||||
Assertions.assertEquals(0x02, podInfoDetailedStatus.getPodMessageCounter());
|
assertThat(podInfoDetailedStatus.getPodMessageCounter()).isEqualTo(0x02);
|
||||||
Assertions.assertEquals(FaultEventCode.OCCLUSION_CHECK_ABOVE_THRESHOLD, podInfoDetailedStatus.getFaultEventCode());
|
assertThat(podInfoDetailedStatus.getFaultEventCode()).isEqualTo(FaultEventCode.OCCLUSION_CHECK_ABOVE_THRESHOLD);
|
||||||
Assertions.assertTrue(Duration.standardMinutes(616).isEqual(podInfoDetailedStatus.getFaultEventTime()));
|
assertThat(podInfoDetailedStatus.getFaultEventTime()).isEqualTo(Duration.standardMinutes(616));
|
||||||
Assertions.assertNull(podInfoDetailedStatus.getReservoirLevel());
|
assertThat(podInfoDetailedStatus.getReservoirLevel()).isNull();
|
||||||
Assertions.assertEquals(0, podInfoDetailedStatus.getUnacknowledgedAlerts().getRawValue());
|
assertThat(podInfoDetailedStatus.getUnacknowledgedAlerts().getRawValue()).isEqualTo(0);
|
||||||
Assertions.assertFalse(podInfoDetailedStatus.isFaultAccessingTables());
|
assertThat(podInfoDetailedStatus.isFaultAccessingTables()).isFalse();
|
||||||
ErrorEventInfo errorEventInfo = podInfoDetailedStatus.getErrorEventInfo();
|
ErrorEventInfo errorEventInfo = podInfoDetailedStatus.getErrorEventInfo();
|
||||||
Assertions.assertFalse(errorEventInfo.isInsulinStateTableCorruption());
|
assertThat(errorEventInfo.isInsulinStateTableCorruption()).isFalse();
|
||||||
Assertions.assertEquals(0x01, errorEventInfo.getInternalVariable());
|
assertThat(errorEventInfo.getInternalVariable()).isEqualTo(0x01);
|
||||||
Assertions.assertFalse(errorEventInfo.isImmediateBolusInProgress());
|
assertThat(errorEventInfo.isImmediateBolusInProgress()).isFalse();
|
||||||
Assertions.assertEquals(PodProgressStatus.ABOVE_FIFTY_UNITS, errorEventInfo.getPodProgressStatus());
|
assertThat(errorEventInfo.getPodProgressStatus()).isEqualTo(PodProgressStatus.ABOVE_FIFTY_UNITS);
|
||||||
Assertions.assertEquals(PodProgressStatus.ABOVE_FIFTY_UNITS, podInfoDetailedStatus.getPreviousPodProgressStatus());
|
assertThat(podInfoDetailedStatus.getPreviousPodProgressStatus()).isEqualTo(PodProgressStatus.ABOVE_FIFTY_UNITS);
|
||||||
Assertions.assertEquals(2, podInfoDetailedStatus.getReceiverLowGain());
|
assertThat(podInfoDetailedStatus.getReceiverLowGain()).isEqualTo(2);
|
||||||
Assertions.assertEquals(39, podInfoDetailedStatus.getRadioRSSI());
|
assertThat(podInfoDetailedStatus.getRadioRSSI()).isEqualTo(39);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testPodInfoFaultEventMaxBolusNotDelivered() {
|
void testPodInfoFaultEventMaxBolusNotDelivered() {
|
||||||
PodInfoDetailedStatus podInfoDetailedStatus = new PodInfoDetailedStatus(ByteUtil.fromHexString("020f00ffff0200ec6a026803ff026b000028a7082023"));
|
PodInfoDetailedStatus podInfoDetailedStatus = new PodInfoDetailedStatus(ByteUtil.fromHexString("020f00ffff0200ec6a026803ff026b000028a7082023"));
|
||||||
|
|
||||||
Assertions.assertEquals(PodProgressStatus.INACTIVE, podInfoDetailedStatus.getPodProgressStatus());
|
assertThat(podInfoDetailedStatus.getPodProgressStatus()).isEqualTo(PodProgressStatus.INACTIVE);
|
||||||
Assertions.assertEquals(DeliveryStatus.SUSPENDED, podInfoDetailedStatus.getDeliveryStatus());
|
assertThat(podInfoDetailedStatus.getDeliveryStatus()).isEqualTo(DeliveryStatus.SUSPENDED);
|
||||||
Assertions.assertEquals(236, podInfoDetailedStatus.getTicksDelivered());
|
assertThat(podInfoDetailedStatus.getTicksDelivered()).isEqualTo(236);
|
||||||
Assertions.assertEquals(11.8, podInfoDetailedStatus.getInsulinDelivered(), 0.000001);
|
assertThat(podInfoDetailedStatus.getInsulinDelivered()).isWithin(0.000001).of(11.8);
|
||||||
Assertions.assertEquals(3276.75, podInfoDetailedStatus.getBolusNotDelivered(), 0.000001); // Insane and will not happen, but this verifies that we convert it to an unsigned int
|
assertThat(podInfoDetailedStatus.getBolusNotDelivered()).isWithin(0.000001).of(3276.75); // Insane and will not happen, but this verifies that we convert it to an unsigned int
|
||||||
Assertions.assertEquals(0x02, podInfoDetailedStatus.getPodMessageCounter());
|
assertThat(podInfoDetailedStatus.getPodMessageCounter()).isEqualTo(0x02);
|
||||||
Assertions.assertEquals(FaultEventCode.OCCLUSION_CHECK_ABOVE_THRESHOLD, podInfoDetailedStatus.getFaultEventCode());
|
assertThat(podInfoDetailedStatus.getFaultEventCode()).isEqualTo(FaultEventCode.OCCLUSION_CHECK_ABOVE_THRESHOLD);
|
||||||
Assertions.assertTrue(Duration.standardMinutes(616).isEqual(podInfoDetailedStatus.getFaultEventTime()));
|
assertThat(podInfoDetailedStatus.getFaultEventTime()).isEqualTo(Duration.standardMinutes(616));
|
||||||
Assertions.assertNull(podInfoDetailedStatus.getReservoirLevel());
|
assertThat(podInfoDetailedStatus.getReservoirLevel()).isNull();
|
||||||
Assertions.assertEquals(0, podInfoDetailedStatus.getUnacknowledgedAlerts().getRawValue());
|
assertThat(podInfoDetailedStatus.getUnacknowledgedAlerts().getRawValue()).isEqualTo(0);
|
||||||
Assertions.assertFalse(podInfoDetailedStatus.isFaultAccessingTables());
|
assertThat(podInfoDetailedStatus.isFaultAccessingTables()).isFalse();
|
||||||
ErrorEventInfo errorEventInfo = podInfoDetailedStatus.getErrorEventInfo();
|
ErrorEventInfo errorEventInfo = podInfoDetailedStatus.getErrorEventInfo();
|
||||||
Assertions.assertFalse(errorEventInfo.isInsulinStateTableCorruption());
|
assertThat(errorEventInfo.isInsulinStateTableCorruption()).isFalse();
|
||||||
Assertions.assertEquals(0x01, errorEventInfo.getInternalVariable());
|
assertThat(errorEventInfo.getInternalVariable()).isEqualTo(0x01);
|
||||||
Assertions.assertFalse(errorEventInfo.isImmediateBolusInProgress());
|
assertThat(errorEventInfo.isImmediateBolusInProgress()).isFalse();
|
||||||
Assertions.assertEquals(PodProgressStatus.ABOVE_FIFTY_UNITS, errorEventInfo.getPodProgressStatus());
|
assertThat(errorEventInfo.getPodProgressStatus()).isEqualTo(PodProgressStatus.ABOVE_FIFTY_UNITS);
|
||||||
Assertions.assertEquals(PodProgressStatus.ABOVE_FIFTY_UNITS, podInfoDetailedStatus.getPreviousPodProgressStatus());
|
assertThat(podInfoDetailedStatus.getPreviousPodProgressStatus()).isEqualTo(PodProgressStatus.ABOVE_FIFTY_UNITS);
|
||||||
Assertions.assertEquals(2, podInfoDetailedStatus.getReceiverLowGain());
|
assertThat(podInfoDetailedStatus.getReceiverLowGain()).isEqualTo(2);
|
||||||
Assertions.assertEquals(39, podInfoDetailedStatus.getRadioRSSI());
|
assertThat(podInfoDetailedStatus.getRadioRSSI()).isEqualTo(39);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testPodInfoFaultEventInsulinStateTableCorruptionFoundDuringErrorLogging() {
|
void testPodInfoFaultEventInsulinStateTableCorruptionFoundDuringErrorLogging() {
|
||||||
PodInfoDetailedStatus podInfoDetailedStatus = new PodInfoDetailedStatus(ByteUtil.fromHexString("020D00000000000012FFFF03FF00160000879A070000"));
|
PodInfoDetailedStatus podInfoDetailedStatus = new PodInfoDetailedStatus(ByteUtil.fromHexString("020D00000000000012FFFF03FF00160000879A070000"));
|
||||||
|
|
||||||
Assertions.assertEquals(PodProgressStatus.FAULT_EVENT_OCCURRED, podInfoDetailedStatus.getPodProgressStatus());
|
assertThat(podInfoDetailedStatus.getPodProgressStatus()).isEqualTo(PodProgressStatus.FAULT_EVENT_OCCURRED);
|
||||||
Assertions.assertEquals(DeliveryStatus.SUSPENDED, podInfoDetailedStatus.getDeliveryStatus());
|
assertThat(podInfoDetailedStatus.getDeliveryStatus()).isEqualTo(DeliveryStatus.SUSPENDED);
|
||||||
Assertions.assertEquals(0, podInfoDetailedStatus.getBolusNotDelivered(), 0.000001);
|
assertThat(podInfoDetailedStatus.getBolusNotDelivered()).isWithin(0.000001).of(0);
|
||||||
Assertions.assertEquals(0x00, podInfoDetailedStatus.getPodMessageCounter());
|
assertThat(podInfoDetailedStatus.getPodMessageCounter()).isEqualTo(0x00);
|
||||||
Assertions.assertEquals(FaultEventCode.RESET_DUE_TO_LVD, podInfoDetailedStatus.getFaultEventCode());
|
assertThat(podInfoDetailedStatus.getFaultEventCode()).isEqualTo(FaultEventCode.RESET_DUE_TO_LVD);
|
||||||
Assertions.assertTrue(Duration.ZERO.isEqual(podInfoDetailedStatus.getFaultEventTime()));
|
assertThat(podInfoDetailedStatus.getFaultEventTime()).isNull();
|
||||||
Assertions.assertNull(podInfoDetailedStatus.getReservoirLevel());
|
assertThat(podInfoDetailedStatus.getReservoirLevel()).isNull();
|
||||||
Assertions.assertTrue(Duration.standardSeconds(1320).isEqual(podInfoDetailedStatus.getTimeActive()));
|
assertThat(podInfoDetailedStatus.getTimeActive()).isEqualTo(Duration.standardSeconds(1320));
|
||||||
Assertions.assertEquals(0, podInfoDetailedStatus.getUnacknowledgedAlerts().getRawValue());
|
assertThat(podInfoDetailedStatus.getUnacknowledgedAlerts().getRawValue()).isEqualTo(0);
|
||||||
Assertions.assertFalse(podInfoDetailedStatus.isFaultAccessingTables());
|
assertThat(podInfoDetailedStatus.isFaultAccessingTables()).isFalse();
|
||||||
ErrorEventInfo errorEventInfo = podInfoDetailedStatus.getErrorEventInfo();
|
ErrorEventInfo errorEventInfo = podInfoDetailedStatus.getErrorEventInfo();
|
||||||
Assertions.assertTrue(errorEventInfo.isInsulinStateTableCorruption());
|
assertThat(errorEventInfo.isInsulinStateTableCorruption()).isTrue();
|
||||||
Assertions.assertEquals(0x00, errorEventInfo.getInternalVariable());
|
assertThat(errorEventInfo.getInternalVariable()).isEqualTo(0x00);
|
||||||
Assertions.assertFalse(errorEventInfo.isImmediateBolusInProgress());
|
assertThat(errorEventInfo.isImmediateBolusInProgress()).isFalse();
|
||||||
Assertions.assertEquals(PodProgressStatus.INSERTING_CANNULA, errorEventInfo.getPodProgressStatus());
|
assertThat(errorEventInfo.getPodProgressStatus()).isEqualTo(PodProgressStatus.INSERTING_CANNULA);
|
||||||
Assertions.assertEquals(PodProgressStatus.INSERTING_CANNULA, podInfoDetailedStatus.getPreviousPodProgressStatus());
|
assertThat(podInfoDetailedStatus.getPreviousPodProgressStatus()).isEqualTo(PodProgressStatus.INSERTING_CANNULA);
|
||||||
Assertions.assertEquals(2, podInfoDetailedStatus.getReceiverLowGain());
|
assertThat(podInfoDetailedStatus.getReceiverLowGain()).isEqualTo(2);
|
||||||
Assertions.assertEquals(26, podInfoDetailedStatus.getRadioRSSI());
|
assertThat(podInfoDetailedStatus.getRadioRSSI()).isEqualTo(26);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue