Rewrites SetBolusMotorPacketTest with matchers

Issue #2745
This commit is contained in:
Ryan Haining 2023-10-08 18:07:12 -07:00
parent a87ba8b708
commit efcc9baa66

View file

@ -1,9 +1,9 @@
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 org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test import org.junit.jupiter.api.Test
class SetBolusMotorPacketTest : MedtrumTestBase() { class SetBolusMotorPacketTest : MedtrumTestBase() {
@ -27,8 +27,6 @@ class SetBolusMotorPacketTest : MedtrumTestBase() {
val result = packet.getRequest() val result = packet.getRequest()
// Expected values // Expected values
val expectedByteArray = byteArrayOf(opCode.toByte()) + 0.toByte() assertThat(result).asList().containsExactly(opCode.toByte(), 0.toByte()).inOrder()
Assertions.assertEquals(2, result.size)
Assertions.assertEquals(expectedByteArray.contentToString(), result.contentToString())
} }
} }