Stronger lambda error (#4771)
* Make sure lambdaError() make the test fail in all circumstances. * Fix existing errors on tests. * Uniformize the way we are creating class under test. * Cleanup * Fix typo * Fix failing test after rebase.
This commit is contained in:
parent
5b9da3c41b
commit
4572419ed2
19 changed files with 289 additions and 279 deletions
|
|
@ -37,7 +37,24 @@ class MediaSenderTest {
|
|||
@Test
|
||||
fun `given an attachment when sending it the preprocessor always runs`() = runTest {
|
||||
val preProcessor = FakeMediaPreProcessor()
|
||||
val sender = createMediaSender(preProcessor)
|
||||
val sender = createMediaSender(
|
||||
preProcessor = preProcessor,
|
||||
room = FakeJoinedRoom(
|
||||
liveTimeline = FakeTimeline().apply {
|
||||
sendFileLambda = lambdaRecorder<
|
||||
File,
|
||||
FileInfo,
|
||||
String?,
|
||||
String?,
|
||||
ProgressCallback?,
|
||||
ReplyParameters?,
|
||||
Result<FakeMediaUploadHandler>,
|
||||
> { _, _, _, _, _, _ ->
|
||||
Result.success(FakeMediaUploadHandler())
|
||||
}
|
||||
},
|
||||
)
|
||||
)
|
||||
|
||||
val uri = Uri.parse("content://image.jpg")
|
||||
sender.sendMedia(uri = uri, mimeType = MimeTypes.Jpeg)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue