Rewrites PodInfoDataLogTest with matchers

Issue #2745
This commit is contained in:
Ryan Haining 2023-09-08 19:52:47 -07:00
parent 19d2f9635a
commit 3d384c7db5

View file

@ -1,9 +1,9 @@
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 org.joda.time.Duration;
import org.junit.jupiter.api.Test;
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.pump.core.utils.ByteUtil; import info.nightscout.pump.core.utils.ByteUtil;
@ -12,10 +12,10 @@ class PodInfoDataLogTest {
void testDecoding() { void testDecoding() {
PodInfoDataLog podInfoDataLog = new PodInfoDataLog(ByteUtil.fromHexString("030100010001043c"), 8); // From https://github.com/ps2/rileylink_ios/blob/omnipod-testing/OmniKitTests/PodInfoTests.swift PodInfoDataLog podInfoDataLog = new PodInfoDataLog(ByteUtil.fromHexString("030100010001043c"), 8); // From https://github.com/ps2/rileylink_ios/blob/omnipod-testing/OmniKitTests/PodInfoTests.swift
Assertions.assertEquals(FaultEventCode.FAILED_FLASH_ERASE, podInfoDataLog.getFaultEventCode()); assertThat(podInfoDataLog.getFaultEventCode()).isEqualTo(FaultEventCode.FAILED_FLASH_ERASE);
Assertions.assertTrue(Duration.standardMinutes(1).isEqual(podInfoDataLog.getTimeFaultEvent())); assertThat(podInfoDataLog.getTimeFaultEvent()).isEqualTo(Duration.standardMinutes(1));
Assertions.assertTrue(Duration.standardMinutes(1).isEqual(podInfoDataLog.getTimeSinceActivation())); assertThat(podInfoDataLog.getTimeSinceActivation()).isEqualTo(Duration.standardMinutes(1));
Assertions.assertEquals(4, podInfoDataLog.getDataChunkSize()); assertThat(podInfoDataLog.getDataChunkSize()).isEqualTo(4);
Assertions.assertEquals(60, podInfoDataLog.getMaximumNumberOfDwords()); assertThat(podInfoDataLog.getMaximumNumberOfDwords()).isEqualTo(60);
} }
} }