You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: stream-chat-android-client/src/test/java/io/getstream/chat/android/client/api2/mapping/DomainMappingTest.kt
+11-1Lines changed: 11 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -558,7 +558,7 @@ internal class DomainMappingTest {
558
558
authorName = attachmentDto.author_name,
559
559
authorLink = attachmentDto.author_link,
560
560
fallback = attachmentDto.fallback,
561
-
fileSize = attachmentDto.file_size,
561
+
fileSize = attachmentDto.file_size?:0,
562
562
image = attachmentDto.image,
563
563
imageUrl = attachmentDto.image_url,
564
564
mimeType = attachmentDto.mime_type,
@@ -576,6 +576,16 @@ internal class DomainMappingTest {
576
576
assertEquals(expected, attachment)
577
577
}
578
578
579
+
@Test
580
+
fun`AttachmentDto with null file_size falls back to 0`() {
581
+
val attachmentDto = randomAttachmentDto(fileSize =null)
582
+
val sut =Fixture().get()
583
+
val attachment =with(sut) {
584
+
attachmentDto.toDomain()
585
+
}
586
+
assertEquals(0, attachment.fileSize)
587
+
}
588
+
579
589
@Test
580
590
fun`BannedUserResponse is correctly mapped to BannedUser`() {
581
591
val bannedUserResponse = randomBannedUserResponse()
Copy file name to clipboardExpand all lines: stream-chat-android-client/src/test/java/io/getstream/chat/android/client/parser2/AttachmentDtoAdapterTest.kt
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -49,4 +49,10 @@ internal class AttachmentDtoAdapterTest {
49
49
val jsonString = parser.toJson(AttachmentDtoTestData.attachmentWithoutExtraData)
Copy file name to clipboardExpand all lines: stream-chat-android-client/src/test/java/io/getstream/chat/android/client/parser2/testdata/AttachmentDtoTestData.kt
0 commit comments