From fa051630193a888f843a9a245bed63a85ef83980 Mon Sep 17 00:00:00 2001 From: Bart Sopers Date: Thu, 11 Feb 2021 00:10:14 +0100 Subject: [PATCH] Add test for SilenceAlertsCommand --- .../pod/command/SilenceAlertsCommandTest.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/SilenceAlertsCommandTest.java b/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/SilenceAlertsCommandTest.java index a107d38e6e..57d9ad20fb 100644 --- a/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/SilenceAlertsCommandTest.java +++ b/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/SilenceAlertsCommandTest.java @@ -1,5 +1,19 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.command; -// TODO capture silence alerts command +import org.apache.commons.codec.DecoderException; +import org.apache.commons.codec.binary.Hex; +import org.junit.Test; + +import static org.junit.Assert.assertArrayEquals; + public class SilenceAlertsCommandTest { + @Test + public void testSilenceLowReservoirAlert() throws DecoderException { + byte[] encoded = new SilenceAlertsCommand(37879811, (short) 1, false, new SilenceAlertsCommand.SilenceAlertCommandParameters(false, false, false, false, true, false, false, false)) // + .getEncoded(); + + assertArrayEquals(Hex.decodeHex("0242000304071105494E532E1081CE"), encoded); + } + + // TODO capture more silence alerts commands } \ No newline at end of file