parent
7055ced8db
commit
59d81e47de
1 changed files with 7 additions and 7 deletions
|
@ -1,10 +1,10 @@
|
||||||
package info.nightscout.pump.medtrum.comm.packets
|
package info.nightscout.pump.medtrum.comm.packets
|
||||||
|
|
||||||
|
import com.google.common.truth.Truth.assertThat
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.pump.medtrum.MedtrumTestBase
|
import info.nightscout.pump.medtrum.MedtrumTestBase
|
||||||
import info.nightscout.pump.medtrum.extension.toByteArray
|
import info.nightscout.pump.medtrum.extension.toByteArray
|
||||||
import org.junit.jupiter.api.Assertions
|
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
|
|
||||||
class ReadBolusStatePacketTest : MedtrumTestBase() {
|
class ReadBolusStatePacketTest : MedtrumTestBase() {
|
||||||
|
@ -31,9 +31,9 @@ class ReadBolusStatePacketTest : MedtrumTestBase() {
|
||||||
val result = packet.handleResponse(response)
|
val result = packet.handleResponse(response)
|
||||||
|
|
||||||
// Expected values
|
// Expected values
|
||||||
Assertions.assertTrue(result)
|
assertThat(result).isTrue()
|
||||||
Assertions.assertFalse(packet.failed)
|
assertThat(packet.failed).isFalse()
|
||||||
Assertions.assertEquals(bolusData.contentToString(), packet.bolusData.contentToString())
|
assertThat(packet.bolusData).isEqualTo(bolusData)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test fun handleResponseGivenResponseWhenMessageTooShortThenResultFalse() {
|
@Test fun handleResponseGivenResponseWhenMessageTooShortThenResultFalse() {
|
||||||
|
@ -47,8 +47,8 @@ class ReadBolusStatePacketTest : MedtrumTestBase() {
|
||||||
val result = packet.handleResponse(response)
|
val result = packet.handleResponse(response)
|
||||||
|
|
||||||
// Expected values
|
// Expected values
|
||||||
Assertions.assertEquals(false, result)
|
assertThat(result).isFalse()
|
||||||
Assertions.assertEquals(true, packet.failed)
|
assertThat(packet.failed).isTrue()
|
||||||
Assertions.assertEquals(byteArrayOf().contentToString(), packet.bolusData.contentToString())
|
assertThat(packet.bolusData).isEmpty()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue