From 6bc2d9eef5d08344bf954a2c6251efc49951602b Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sat, 11 Jan 2020 16:26:34 +0100 Subject: [PATCH] DanaRv2.comm --- .../danaRv2/comm/MsgCheckValue_v2Test.java | 61 ---------------- .../pump/danaRv2/comm/MsgCheckValue_v2Test.kt | 70 +++++++++++++++++++ 2 files changed, 70 insertions(+), 61 deletions(-) delete mode 100644 app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRv2/comm/MsgCheckValue_v2Test.java create mode 100644 app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRv2/comm/MsgCheckValue_v2Test.kt diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRv2/comm/MsgCheckValue_v2Test.java b/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRv2/comm/MsgCheckValue_v2Test.java deleted file mode 100644 index d7910d313d..0000000000 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRv2/comm/MsgCheckValue_v2Test.java +++ /dev/null @@ -1,61 +0,0 @@ -package info.nightscout.androidaps.plugins.pump.danaRv2.comm; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; - -import info.AAPSMocker; -import info.nightscout.androidaps.MainApp; -import info.nightscout.androidaps.logging.L; -import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin; -import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin; -import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump; -import info.nightscout.androidaps.plugins.pump.danaRv2.DanaRv2Plugin; -import info.nightscout.androidaps.plugins.treatments.Treatment; -import info.nightscout.androidaps.queue.CommandQueue; -import info.nightscout.androidaps.utils.SP; - -import static org.junit.Assert.*; -import static org.powermock.api.mockito.PowerMockito.when; - -@RunWith(PowerMockRunner.class) -@PrepareForTest({MainApp.class, SP.class, L.class, ConfigBuilderPlugin.class, CommandQueue.class}) -public class MsgCheckValue_v2Test { - @Test - public void runTest() { - Treatment t = new Treatment(); - MsgCheckValue_v2 packet = new MsgCheckValue_v2(); - // test message decoding - packet.handleMessage(createArray(34, (byte) 3)); - DanaRPump pump = DanaRPump.getInstance(); - assertEquals(DanaRPump.EXPORT_MODEL, pump.model); - } - - byte[] createArray(int length, byte fillWith){ - byte[] ret = new byte[length]; - for(int i = 0; i