mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 15:44:54 +00:00
Extract fun to create VideoInfo in test.
This commit is contained in:
+15
-10
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user