Extract fun to create VideoInfo in test.
This commit is contained in:
parent
ef52f2a645
commit
72d861af50
1 changed files with 15 additions and 10 deletions
|
|
@ -61,6 +61,7 @@ import io.element.android.libraries.matrix.ui.components.AttachmentThumbnailType
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.junit.runner.RunWith
|
import org.junit.runner.RunWith
|
||||||
|
import kotlin.time.Duration.Companion.minutes
|
||||||
|
|
||||||
@RunWith(AndroidJUnit4::class)
|
@RunWith(AndroidJUnit4::class)
|
||||||
class InReplyToMetadataKtTest {
|
class InReplyToMetadataKtTest {
|
||||||
|
|
@ -137,16 +138,7 @@ class InReplyToMetadataKtTest {
|
||||||
messageType = VideoMessageType(
|
messageType = VideoMessageType(
|
||||||
body = "body",
|
body = "body",
|
||||||
source = aMediaSource(),
|
source = aMediaSource(),
|
||||||
info = VideoInfo(
|
info = aVideoInfo(),
|
||||||
duration = null,
|
|
||||||
height = null,
|
|
||||||
width = null,
|
|
||||||
mimetype = null,
|
|
||||||
size = null,
|
|
||||||
thumbnailInfo = null,
|
|
||||||
thumbnailSource = aMediaSource(),
|
|
||||||
blurhash = A_BLUR_HASH
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
).metadata()
|
).metadata()
|
||||||
|
|
@ -447,6 +439,19 @@ fun anInReplyToDetails(
|
||||||
textContent = textContent,
|
textContent = textContent,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fun aVideoInfo(): VideoInfo {
|
||||||
|
return VideoInfo(
|
||||||
|
duration = 1.minutes,
|
||||||
|
height = 100,
|
||||||
|
width = 100,
|
||||||
|
mimetype = "video/mp4",
|
||||||
|
size = 1000,
|
||||||
|
thumbnailInfo = null,
|
||||||
|
thumbnailSource = aMediaSource(),
|
||||||
|
blurhash = A_BLUR_HASH,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
fun anImageInfo(): ImageInfo {
|
fun anImageInfo(): ImageInfo {
|
||||||
return ImageInfo(
|
return ImageInfo(
|
||||||
height = 100,
|
height = 100,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue