diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRSMessageHashTableTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRSMessageHashTableTest.kt index 55a3539d8b..53a9a2b6b1 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRSMessageHashTableTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRSMessageHashTableTest.kt @@ -1,10 +1,8 @@ package info.nightscout.androidaps.plugins.pump.danaRS.comm import com.cozmo.danar.util.BleCommandUtil -import info.TestBase import info.nightscout.androidaps.interfaces.ActivePluginProvider import info.nightscout.androidaps.interfaces.Constraint -import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.plugins.bus.RxBusWrapper import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump @@ -12,7 +10,6 @@ import info.nightscout.androidaps.plugins.pump.danaRS.DanaRSPlugin import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.sharedPreferences.SP import org.junit.Assert -import org.junit.Before import org.junit.Test import org.junit.runner.RunWith import org.mockito.Mock @@ -22,16 +19,13 @@ import org.powermock.modules.junit4.PowerMockRunner @RunWith(PowerMockRunner::class) @PrepareForTest(ConstraintChecker::class) -class DanaRSMessageHashTableTest : TestBase() { +class DanaRSMessageHashTableTest : DanaRSTestBase() { - @Mock lateinit var aapsLogger: AAPSLogger @Mock lateinit var rxBus: RxBusWrapper @Mock lateinit var resourceHelper: ResourceHelper @Mock lateinit var danaRSPlugin: DanaRSPlugin @Mock lateinit var activePlugin: ActivePluginProvider @Mock lateinit var constraintChecker: ConstraintChecker - @Mock lateinit var sp: SP - lateinit var danaRPump: DanaRPump @Test fun runTest() { @@ -42,9 +36,4 @@ class DanaRSMessageHashTableTest : TestBase() { val testPacket: DanaRS_Packet = danaRSMessageHashTable.findMessage(forTesting.command) Assert.assertEquals(BleCommandUtil.DANAR_PACKET__OPCODE__APS_SET_EVENT_HISTORY.toLong(), testPacket.getOpCode().toLong()) } - - @Before - fun setup() { - danaRPump = DanaRPump(aapsLogger, sp) - } } \ No newline at end of file diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRSTestBase.kt b/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRSTestBase.kt new file mode 100644 index 0000000000..b9d3457b35 --- /dev/null +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRSTestBase.kt @@ -0,0 +1,28 @@ +package info.nightscout.androidaps.plugins.pump.danaRS.comm + +import info.nightscout.androidaps.logging.AAPSLogger +import info.nightscout.androidaps.plugins.pump.danaR.DanaRPump +import info.nightscout.androidaps.utils.sharedPreferences.SP +import org.junit.Before +import org.mockito.Mock + +open class DanaRSTestBase : TestBase() { + + @Mock lateinit var aapsLogger: AAPSLogger + @Mock lateinit var sp: SP + + lateinit var danaRPump: DanaRPump + + fun createArray(length: Int, fillWith: Byte): ByteArray { + val ret = ByteArray(length) + for (i in 0 until length) { + ret[i] = fillWith + } + return ret + } + + @Before + fun setup() { + danaRPump = DanaRPump(aapsLogger, sp) + } +} \ No newline at end of file diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_Basal_Set_Temporary_BasalTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_Basal_Set_Temporary_BasalTest.kt index 7196e4ba87..835a56be84 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_Basal_Set_Temporary_BasalTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_Basal_Set_Temporary_BasalTest.kt @@ -1,19 +1,14 @@ package info.nightscout.androidaps.plugins.pump.danaRS.comm -import info.TestBase -import info.nightscout.androidaps.logging.AAPSLogger import org.junit.Assert 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 @RunWith(PowerMockRunner::class) @PrepareForTest() -class DanaRS_Packet_APS_Basal_Set_Temporary_BasalTest : TestBase() { - - @Mock lateinit var aapsLogger: AAPSLogger +class DanaRS_Packet_APS_Basal_Set_Temporary_BasalTest : DanaRSTestBase() { @Test fun runTest() { diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_History_EventsTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_History_EventsTest.kt index 42cf5bf7eb..b9f30c9b45 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_History_EventsTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_History_EventsTest.kt @@ -1,8 +1,6 @@ package info.nightscout.androidaps.plugins.pump.danaRS.comm -import info.TestBase import info.nightscout.androidaps.interfaces.ActivePluginProvider -import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.plugins.bus.RxBusWrapper import info.nightscout.androidaps.plugins.pump.danaRS.DanaRSPlugin import info.nightscout.androidaps.utils.DateUtil @@ -17,9 +15,8 @@ import java.util.* @RunWith(PowerMockRunner::class) @PrepareForTest(RxBusWrapper::class) -class DanaRS_Packet_APS_History_EventsTest : TestBase() { +class DanaRS_Packet_APS_History_EventsTest : DanaRSTestBase() { - @Mock lateinit var aapsLogger: AAPSLogger @Mock lateinit var rxBus: RxBusWrapper @Mock lateinit var resourceHelper: ResourceHelper @Mock lateinit var activePlugin: ActivePluginProvider @@ -50,14 +47,6 @@ class DanaRS_Packet_APS_History_EventsTest : TestBase() { Assert.assertEquals("APS_HISTORY_EVENTS", testPacket.friendlyName) } - fun createArray(length: Int, fillWith: Byte): ByteArray { - val ret = ByteArray(length) - for (i in 0 until length) { - ret[i] = fillWith - } - return ret - } - fun getCalender(from: Long): ByteArray { val cal = GregorianCalendar() if (from != 0L) cal.timeInMillis = from else cal[2000, 0, 1, 0, 0] = 0 diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_Set_Event_HistoryTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_Set_Event_HistoryTest.kt index e20b2e7f83..4c293eb5fa 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_Set_Event_HistoryTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_APS_Set_Event_HistoryTest.kt @@ -19,13 +19,7 @@ import org.powermock.modules.junit4.PowerMockRunner @RunWith(PowerMockRunner::class) @PrepareForTest() -class DanaRS_Packet_APS_Set_Event_HistoryTest { - - @Mock lateinit var aapsLogger: AAPSLogger - @Mock lateinit var rxBus: RxBusWrapper - @Mock lateinit var resourceHelper: ResourceHelper - @Mock lateinit var activePlugin: ActivePluginProvider - @Mock lateinit var danaRSPlugin: DanaRSPlugin +class DanaRS_Packet_APS_Set_Event_HistoryTest : DanaRSTestBase() { @Test fun runTest() { // test for negative carbs val now = DateUtil.now() diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Basal_RateTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Basal_RateTest.java deleted file mode 100644 index 762403142f..0000000000 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Basal_RateTest.java +++ /dev/null @@ -1,50 +0,0 @@ -package info.nightscout.androidaps.plugins.pump.danaRS.comm; - - -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.utils.SP; - -import static org.junit.Assert.assertEquals; - -/** - * Created by Rumen on 01.08.2018 - */ - -@RunWith(PowerMockRunner.class) -@PrepareForTest({MainApp.class, SP.class, L.class}) -public class DanaRS_Packet_Basal_Get_Basal_RateTest { - - @Test - public void runTest() { - AAPSMocker.mockMainApp(); - AAPSMocker.mockApplicationContext(); - AAPSMocker.mockSP(); - AAPSMocker.mockL(); - - DanaRS_Packet_Basal_Get_Basal_Rate packet = new DanaRS_Packet_Basal_Get_Basal_Rate(); - - // test message decoding - // rate is 0.01 - packet.handleMessage(createArray(100, (byte) 1)); - assertEquals(false, packet.failed); - packet.handleMessage(createArray(100, (byte) 5)); - assertEquals(true, packet.failed); - - assertEquals("BASAL__GET_BASAL_RATE", packet.getFriendlyName()); - } - - byte[] createArray(int length, byte fillWith){ - byte[] ret = new byte[length]; - for(int i = 0; i 1U/hr - double basal120 = byteArrayToInt(getBytes(createArray(50, (byte) 120), 2, 2)) / 100d; - DanaRS_Packet_Basal_Get_Profile_Basal_Rate testPacket = new DanaRS_Packet_Basal_Get_Profile_Basal_Rate(1); - byte[] params = testPacket.getRequestParams(); - assertEquals((byte) 1, params[0]); - testPacket.handleMessage(createArray(50, (byte) 0)); - assertEquals(0.0d, testPacket.pump.pumpProfiles[1][1],0); - testPacket.handleMessage(createArray(50, (byte) 1)); - assertEquals(basal01, testPacket.pump.pumpProfiles[1][2],0); - testPacket.handleMessage(createArray(50, (byte) 5)); - assertEquals(basal05, testPacket.pump.pumpProfiles[1][1],0); - testPacket.handleMessage(createArray(50, (byte) 12)); - assertEquals(basal12, testPacket.pump.pumpProfiles[1][1],0); - testPacket.handleMessage(createArray(50, (byte) 120)); - assertEquals(basal120, testPacket.pump.pumpProfiles[1][1],0); - - assertEquals("BASAL__GET_PROFILE_BASAL_RATE", getFriendlyName()); - } - - byte[] createArray(int length, byte fillWith){ - byte[] ret = new byte[length]; - for(int i = 0; i 1U/hr + val basal120 = byteArrayToInt(getBytes(createArray(50, 120.toByte()), 2, 2)) / 100.0 + val params = testPacket.requestParams + assertEquals(1.toByte(), params[0]) + testPacket.handleMessage(createArray(50, 0.toByte())) + assertEquals(0.0, danaRPump.pumpProfiles!![1][1], 0.0) + testPacket.handleMessage(createArray(50, 1.toByte())) + assertEquals(basal01, danaRPump.pumpProfiles!![1][2], 0.0) + testPacket.handleMessage(createArray(50, 5.toByte())) + assertEquals(basal05, danaRPump.pumpProfiles!![1][1], 0.0) + testPacket.handleMessage(createArray(50, 12.toByte())) + assertEquals(basal12, danaRPump.pumpProfiles!![1][1], 0.0) + testPacket.handleMessage(createArray(50, 120.toByte())) + assertEquals(basal120, danaRPump.pumpProfiles!![1][1], 0.0) + assertEquals("BASAL__GET_PROFILE_BASAL_RATE", testPacket.friendlyName) + } +} \ No newline at end of file diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Profile_NumberTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Profile_NumberTest.java deleted file mode 100644 index 2aeb278110..0000000000 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Profile_NumberTest.java +++ /dev/null @@ -1,41 +0,0 @@ -package info.nightscout.androidaps.plugins.pump.danaRS.comm; - - -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.utils.SP; - -import static org.junit.Assert.assertEquals; - -/** - * Created by Rumen on 01.08.2018. - */ - -@RunWith(PowerMockRunner.class) -@PrepareForTest({MainApp.class, SP.class, L.class}) -public class DanaRS_Packet_Basal_Get_Profile_NumberTest { - - @Test - public void runTest() { - AAPSMocker.mockMainApp(); - AAPSMocker.mockApplicationContext(); - AAPSMocker.mockSP(); - AAPSMocker.mockL(); - - DanaRS_Packet_Basal_Get_Profile_Number packet = new DanaRS_Packet_Basal_Get_Profile_Number(); - - // test message decoding - packet.handleMessage(new byte[]{(byte) 0, (byte) 0, (byte) 0}); - assertEquals(false, packet.failed); - // if data.length > 4 should return fail - - assertEquals("BASAL__GET_PROFILE_NUMBER", packet.getFriendlyName()); - } - -} diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Profile_NumberTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Profile_NumberTest.kt new file mode 100644 index 0000000000..32b495380f --- /dev/null +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Profile_NumberTest.kt @@ -0,0 +1,21 @@ +package info.nightscout.androidaps.plugins.pump.danaRS.comm + +import org.junit.Assert +import org.junit.Test +import org.junit.runner.RunWith +import org.powermock.core.classloader.annotations.PrepareForTest +import org.powermock.modules.junit4.PowerMockRunner + +@RunWith(PowerMockRunner::class) +@PrepareForTest() +class DanaRS_Packet_Basal_Get_Profile_NumberTest : DanaRSTestBase() { + + @Test fun runTest() { + val packet = DanaRS_Packet_Basal_Get_Profile_Number(aapsLogger, danaRPump) + // test message decoding + packet.handleMessage(byteArrayOf(0.toByte(), 0.toByte(), 0.toByte())) + Assert.assertEquals(false, packet.failed) + // if data.length > 4 should return fail + Assert.assertEquals("BASAL__GET_PROFILE_NUMBER", packet.friendlyName) + } +} \ No newline at end of file diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Temporary_Basal_StateTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Temporary_Basal_StateTest.java deleted file mode 100644 index 1233762ab1..0000000000 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Temporary_Basal_StateTest.java +++ /dev/null @@ -1,49 +0,0 @@ -package info.nightscout.androidaps.plugins.pump.danaRS.comm; - - -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.utils.SP; - -import static org.junit.Assert.assertEquals; - -/** - * Created by Rumen on 01.08.2018. - */ - -@RunWith(PowerMockRunner.class) -@PrepareForTest({MainApp.class, SP.class, L.class}) -public class DanaRS_Packet_Basal_Get_Temporary_Basal_StateTest { - - @Test - public void runTest() { - AAPSMocker.mockMainApp(); - AAPSMocker.mockApplicationContext(); - AAPSMocker.mockSP(); - AAPSMocker.mockL(); - - DanaRS_Packet_Basal_Get_Temporary_Basal_State packet = new DanaRS_Packet_Basal_Get_Temporary_Basal_State(); - - // test message decoding - packet.handleMessage(createArray(50,(byte) 0)); - assertEquals(false, packet.failed); - packet.handleMessage(createArray(50,(byte) 1)); - assertEquals(true, packet.failed); - - assertEquals("BASAL__TEMPORARY_BASAL_STATE", packet.getFriendlyName()); - } - - byte[] createArray(int length, byte fillWith) { - byte[] ret = new byte[length]; - for (int i = 0; i < length; i++) { - ret[i] = fillWith; - } - return ret; - } -} diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Temporary_Basal_StateTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Temporary_Basal_StateTest.kt new file mode 100644 index 0000000000..f59d17135e --- /dev/null +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Basal_Get_Temporary_Basal_StateTest.kt @@ -0,0 +1,22 @@ +package info.nightscout.androidaps.plugins.pump.danaRS.comm + +import org.junit.Assert +import org.junit.Test +import org.junit.runner.RunWith +import org.powermock.core.classloader.annotations.PrepareForTest +import org.powermock.modules.junit4.PowerMockRunner + +@RunWith(PowerMockRunner::class) +@PrepareForTest() +class DanaRS_Packet_Basal_Get_Temporary_Basal_StateTest : DanaRSTestBase() { + + @Test fun runTest() { + val packet = DanaRS_Packet_Basal_Get_Temporary_Basal_State(aapsLogger, danaRPump) + // test message decoding + packet.handleMessage(createArray(50, 0.toByte())) + Assert.assertEquals(false, packet.failed) + packet.handleMessage(createArray(50, 1.toByte())) + Assert.assertEquals(true, packet.failed) + Assert.assertEquals("BASAL__TEMPORARY_BASAL_STATE", packet.friendlyName) + } +} \ No newline at end of file diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Step_Bolus_StopTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Step_Bolus_StopTest.kt index ae68b1c123..dc2757724c 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Step_Bolus_StopTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Bolus_Set_Step_Bolus_StopTest.kt @@ -2,7 +2,6 @@ package info.nightscout.androidaps.plugins.pump.danaRS.comm import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.TestBase import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.plugins.bus.RxBusWrapper import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin @@ -22,11 +21,10 @@ import org.powermock.modules.junit4.PowerMockRunner @RunWith(PowerMockRunner::class) @PrepareForTest(RxBusWrapper::class) -class DanaRS_Packet_Bolus_Set_Step_Bolus_StopTest : TestBase() { +class DanaRS_Packet_Bolus_Set_Step_Bolus_StopTest : DanaRSTestBase() { @Mock lateinit var defaultValueHelper: DefaultValueHelper @Mock lateinit var rxBus: RxBusWrapper - @Mock lateinit var aapsLogger: AAPSLogger @Mock lateinit var resourceHelper: ResourceHelper @Mock lateinit var profileFunction: ProfileFunction @Mock lateinit var configBuilderPlugin: ConfigBuilderPlugin diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Notify_Delivery_CompleteTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Notify_Delivery_CompleteTest.kt index 501b8472c8..16f73e6fd9 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Notify_Delivery_CompleteTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/DanaRS_Packet_Notify_Delivery_CompleteTest.kt @@ -2,8 +2,6 @@ package info.nightscout.androidaps.plugins.pump.danaRS.comm import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.TestBase -import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.plugins.bus.RxBusWrapper import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin import info.nightscout.androidaps.plugins.configBuilder.ProfileFunction @@ -23,11 +21,10 @@ import org.powermock.modules.junit4.PowerMockRunner @RunWith(PowerMockRunner::class) @PrepareForTest(RxBusWrapper::class) -class DanaRS_Packet_Notify_Delivery_CompleteTest : TestBase() { +class DanaRS_Packet_Notify_Delivery_CompleteTest : DanaRSTestBase() { @Mock lateinit var defaultValueHelper: DefaultValueHelper @Mock lateinit var rxBus: RxBusWrapper - @Mock lateinit var aapsLogger: AAPSLogger @Mock lateinit var resourceHelper: ResourceHelper @Mock lateinit var danaRSPlugin: DanaRSPlugin @Mock lateinit var profileFunction: ProfileFunction @@ -56,20 +53,4 @@ class DanaRS_Packet_Notify_Delivery_CompleteTest : TestBase() { Assert.assertEquals(true, danaRSPlugin.bolusDone) Assert.assertEquals("NOTIFY__DELIVERY_COMPLETE", packet.friendlyName) } - - fun createArray(length: Int, fillWith: Byte): ByteArray { - val ret = ByteArray(length) - for (i in 0 until length) { - ret[i] = fillWith - } - return ret - } - - fun createArray(length: Int, fillWith: Double): DoubleArray { - val ret = DoubleArray(length) - for (i in 0 until length) { - ret[i] = fillWith - } - return ret - } } \ No newline at end of file diff --git a/app/src/test/java/info/TestBase.kt b/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/TestBase.kt similarity index 92% rename from app/src/test/java/info/TestBase.kt rename to app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/TestBase.kt index 235e470e65..669050f762 100644 --- a/app/src/test/java/info/TestBase.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/danaRS/comm/TestBase.kt @@ -1,4 +1,4 @@ -package info +package info.nightscout.androidaps.plugins.pump.danaRS.comm import org.junit.Rule import org.mockito.Mockito