From 9c926a226547607524ccd01e34b17c82ddb7bb93 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sat, 29 Aug 2020 19:51:10 +0600 Subject: [PATCH] update SimpleInputFilesTest --- .../TelegramBotAPI/SimpleInputFilesTest.kt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/TelegramBotAPI-core/src/commonTest/kotlin/com/github/insanusmokrassar/TelegramBotAPI/SimpleInputFilesTest.kt b/TelegramBotAPI-core/src/commonTest/kotlin/com/github/insanusmokrassar/TelegramBotAPI/SimpleInputFilesTest.kt index ef50f0afbf..b3fa9127e2 100644 --- a/TelegramBotAPI-core/src/commonTest/kotlin/com/github/insanusmokrassar/TelegramBotAPI/SimpleInputFilesTest.kt +++ b/TelegramBotAPI-core/src/commonTest/kotlin/com/github/insanusmokrassar/TelegramBotAPI/SimpleInputFilesTest.kt @@ -6,6 +6,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.files.PhotoSize import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.media.PhotoContent import kotlinx.serialization.json.Json import kotlin.test.Test +import kotlin.test.assertEquals private val nonstrictJsonFormat = Json { isLenient = true @@ -22,9 +23,17 @@ class SimpleInputFilesTest { PhotoSize("example_file_id".toInputFile(), "example_unique_file_id", 100, 100, 100) ) ) - nonstrictJsonFormat.encodeToString( + val inputMedia = photoContent.toMediaGroupMemberInputMedia() + val encoded = nonstrictJsonFormat.encodeToString( MediaGroupMemberInputMediaSerializer, - photoContent.toMediaGroupMemberInputMedia() + inputMedia + ) + assertEquals( + inputMedia, + nonstrictJsonFormat.decodeFromString( + MediaGroupMemberInputMediaSerializer, + encoded + ) ) } }