Merge branch 'avereha/dev2-merge' into avereha/temp-basals
This commit is contained in:
commit
684250a40f
10 changed files with 17 additions and 23 deletions
|
@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.endecry
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLoggerTest
|
import info.nightscout.androidaps.logging.AAPSLoggerTest
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message.MessagePacket
|
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message.MessagePacket
|
||||||
import info.nightscout.androidaps.utils.extensions.toHex
|
import info.nightscout.androidaps.extensions.toHex
|
||||||
import org.junit.Assert
|
import org.junit.Assert
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.spongycastle.util.encoders.Hex
|
import org.spongycastle.util.encoders.Hex
|
||||||
|
|
|
@ -3,7 +3,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message
|
||||||
import com.google.crypto.tink.subtle.Hex
|
import com.google.crypto.tink.subtle.Hex
|
||||||
import info.nightscout.androidaps.logging.AAPSLoggerTest
|
import info.nightscout.androidaps.logging.AAPSLoggerTest
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.Id
|
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.Id
|
||||||
import info.nightscout.androidaps.utils.extensions.toHex
|
import info.nightscout.androidaps.extensions.toHex
|
||||||
import org.junit.Assert.assertEquals
|
import org.junit.Assert.assertEquals
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message
|
||||||
|
|
||||||
import com.google.crypto.tink.subtle.Hex
|
import com.google.crypto.tink.subtle.Hex
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.packet.PayloadJoiner
|
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.packet.PayloadJoiner
|
||||||
import info.nightscout.androidaps.utils.extensions.toHex
|
import info.nightscout.androidaps.extensions.toHex
|
||||||
import org.junit.Assert.assertEquals
|
import org.junit.Assert.assertEquals
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message
|
||||||
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.packet.PayloadJoiner
|
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.packet.PayloadJoiner
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.packet.PayloadSplitter
|
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.packet.PayloadSplitter
|
||||||
import info.nightscout.androidaps.utils.extensions.toHex
|
import info.nightscout.androidaps.extensions.toHex
|
||||||
import org.junit.Assert.assertEquals
|
import org.junit.Assert.assertEquals
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
|
@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message
|
||||||
|
|
||||||
import com.google.crypto.tink.subtle.Hex
|
import com.google.crypto.tink.subtle.Hex
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.packet.PayloadSplitter
|
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.packet.PayloadSplitter
|
||||||
import info.nightscout.androidaps.utils.extensions.toHex
|
import info.nightscout.androidaps.extensions.toHex
|
||||||
import org.junit.Assert.assertEquals
|
import org.junit.Assert.assertEquals
|
||||||
import org.junit.Assert.assertTrue
|
import org.junit.Assert.assertTrue
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message
|
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message
|
||||||
|
|
||||||
import com.google.crypto.tink.subtle.Hex
|
import com.google.crypto.tink.subtle.Hex
|
||||||
import info.nightscout.androidaps.utils.extensions.toHex
|
import info.nightscout.androidaps.extensions.toHex
|
||||||
import org.junit.Assert.assertEquals
|
import org.junit.Assert.assertEquals
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.pair
|
||||||
import info.nightscout.androidaps.logging.AAPSLoggerTest
|
import info.nightscout.androidaps.logging.AAPSLoggerTest
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.util.RandomByteGenerator
|
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.util.RandomByteGenerator
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.util.X25519KeyGenerator
|
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.util.X25519KeyGenerator
|
||||||
import info.nightscout.androidaps.utils.extensions.toHex
|
import info.nightscout.androidaps.extensions.toHex
|
||||||
import org.junit.Assert.assertEquals
|
import org.junit.Assert.assertEquals
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.mockito.ArgumentMatchers.anyInt
|
import org.mockito.ArgumentMatchers.anyInt
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.session
|
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.session
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLoggerTest
|
import info.nightscout.androidaps.logging.AAPSLoggerTest
|
||||||
import info.nightscout.androidaps.utils.extensions.toHex
|
import info.nightscout.androidaps.extensions.toHex
|
||||||
import org.junit.Assert
|
import org.junit.Assert
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.spongycastle.util.encoders.Hex
|
import org.spongycastle.util.encoders.Hex
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.session
|
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.session
|
||||||
|
|
||||||
import info.nightscout.androidaps.logging.AAPSLoggerTest
|
import info.nightscout.androidaps.logging.AAPSLoggerTest
|
||||||
import info.nightscout.androidaps.utils.extensions.toHex
|
import info.nightscout.androidaps.extensions.toHex
|
||||||
import org.junit.Assert
|
import org.junit.Assert
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.spongycastle.util.encoders.Hex
|
import org.spongycastle.util.encoders.Hex
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.omnipod.dash.util
|
package info.nightscout.androidaps.plugins.pump.omnipod.dash.util
|
||||||
|
|
||||||
import info.nightscout.androidaps.data.Profile
|
import info.nightscout.androidaps.interfaces.Profile
|
||||||
import info.nightscout.androidaps.data.Profile.ProfileValue
|
import info.nightscout.androidaps.interfaces.Profile.ProfileValue
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.BasalProgram
|
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.BasalProgram
|
||||||
import org.junit.Assert.assertEquals
|
import org.junit.Assert.assertEquals
|
||||||
import org.junit.Rule
|
import org.junit.Rule
|
||||||
|
@ -26,7 +26,7 @@ class FunctionsTest {
|
||||||
val value3 = Mockito.mock(ProfileValue::class.java)
|
val value3 = Mockito.mock(ProfileValue::class.java)
|
||||||
value3.timeAsSeconds = 50400
|
value3.timeAsSeconds = 50400
|
||||||
value3.value = 3.05
|
value3.value = 3.05
|
||||||
PowerMockito.`when`(profile.basalValues).thenReturn(
|
PowerMockito.`when`(profile.getBasalValues()).thenReturn(
|
||||||
arrayOf(
|
arrayOf(
|
||||||
value1,
|
value1,
|
||||||
value2,
|
value2,
|
||||||
|
@ -50,17 +50,11 @@ class FunctionsTest {
|
||||||
assertEquals(48.toShort(), entry3.endSlotIndex)
|
assertEquals(48.toShort(), entry3.endSlotIndex)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test fun invalidProfileNullEntries() {
|
|
||||||
thrown.expect(IllegalArgumentException::class.java)
|
|
||||||
thrown.expectMessage("Basal values can not be null")
|
|
||||||
mapProfileToBasalProgram(Mockito.mock(Profile::class.java))
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test fun invalidProfileZeroEntries() {
|
@Test fun invalidProfileZeroEntries() {
|
||||||
thrown.expect(IllegalArgumentException::class.java)
|
thrown.expect(IllegalArgumentException::class.java)
|
||||||
thrown.expectMessage("Basal values should contain values")
|
thrown.expectMessage("Basal values should contain values")
|
||||||
val profile = Mockito.mock(Profile::class.java)
|
val profile = Mockito.mock(Profile::class.java)
|
||||||
PowerMockito.`when`(profile.basalValues).thenReturn(arrayOfNulls(0))
|
PowerMockito.`when`(profile.getBasalValues()).thenReturn(emptyArray())
|
||||||
mapProfileToBasalProgram(profile)
|
mapProfileToBasalProgram(profile)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +65,7 @@ class FunctionsTest {
|
||||||
val value = Mockito.mock(ProfileValue::class.java)
|
val value = Mockito.mock(ProfileValue::class.java)
|
||||||
value.timeAsSeconds = 1800
|
value.timeAsSeconds = 1800
|
||||||
value.value = 0.5
|
value.value = 0.5
|
||||||
PowerMockito.`when`(profile.basalValues).thenReturn(
|
PowerMockito.`when`(profile.getBasalValues()).thenReturn(
|
||||||
arrayOf(
|
arrayOf(
|
||||||
value
|
value
|
||||||
)
|
)
|
||||||
|
@ -90,7 +84,7 @@ class FunctionsTest {
|
||||||
val value2 = Mockito.mock(ProfileValue::class.java)
|
val value2 = Mockito.mock(ProfileValue::class.java)
|
||||||
value2.timeAsSeconds = 86400
|
value2.timeAsSeconds = 86400
|
||||||
value2.value = 0.5
|
value2.value = 0.5
|
||||||
PowerMockito.`when`(profile.basalValues).thenReturn(
|
PowerMockito.`when`(profile.getBasalValues()).thenReturn(
|
||||||
arrayOf(
|
arrayOf(
|
||||||
value1,
|
value1,
|
||||||
value2
|
value2
|
||||||
|
@ -106,7 +100,7 @@ class FunctionsTest {
|
||||||
val value = Mockito.mock(ProfileValue::class.java)
|
val value = Mockito.mock(ProfileValue::class.java)
|
||||||
value.timeAsSeconds = -1
|
value.timeAsSeconds = -1
|
||||||
value.value = 0.5
|
value.value = 0.5
|
||||||
PowerMockito.`when`(profile.basalValues).thenReturn(
|
PowerMockito.`when`(profile.getBasalValues()).thenReturn(
|
||||||
arrayOf(
|
arrayOf(
|
||||||
value
|
value
|
||||||
)
|
)
|
||||||
|
@ -119,7 +113,7 @@ class FunctionsTest {
|
||||||
val value = Mockito.mock(ProfileValue::class.java)
|
val value = Mockito.mock(ProfileValue::class.java)
|
||||||
value.timeAsSeconds = 0
|
value.timeAsSeconds = 0
|
||||||
value.value = 0.04
|
value.value = 0.04
|
||||||
PowerMockito.`when`(profile.basalValues).thenReturn(
|
PowerMockito.`when`(profile.getBasalValues()).thenReturn(
|
||||||
arrayOf(
|
arrayOf(
|
||||||
value
|
value
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue