Skip to content

Commit

Permalink
Update test verification to use coVerify since code runs in a coroutine
Browse files Browse the repository at this point in the history
  • Loading branch information
Rkareko committed Sep 13, 2024
1 parent 5bc8092 commit b48e066
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -803,10 +803,10 @@ class WifiDirectDataSharingStrategyTest : RobolectricTest() {

coVerify { dataInputStream.readLong() }
coVerify { dataInputStream.read(any(), 0, bytePayload.size) }
verify { wifiDirectDataSharingStrategy invoke "logDebug" withArguments listOf("file size 0") }
coVerify { wifiDirectDataSharingStrategy invoke "logDebug" withArguments listOf("file size 0") }

val bytePayloadSlot = slot<BytePayload>()
verify { payloadReceiptListener.onPayloadReceived(capture(bytePayloadSlot)) }
coVerify { payloadReceiptListener.onPayloadReceived(capture(bytePayloadSlot)) }
Assert.assertArrayEquals(bytePayload, bytePayloadSlot.captured.payload)
}

Expand Down

0 comments on commit b48e066

Please sign in to comment.