1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 08:13:47 +00:00

TelegramDateTests now using strict json

This commit is contained in:
InsanusMokrassar 2020-03-22 15:56:05 +06:00
parent c5c8a743e6
commit d18863b7b3

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.types
import com.github.insanusmokrassar.TelegramBotAPI.NonstrictTestsJsonFormat
import com.github.insanusmokrassar.TelegramBotAPI.TestsJsonFormat
import com.soywiz.klock.DateTime
import kotlinx.serialization.ImplicitReflectionSerializer
import kotlinx.serialization.Serializable
@ -21,10 +21,10 @@ class TelegramDateTests {
fun `Serializtion of TelegramDate is working correctly`() {
val example = Example(TelegramDate(dateTimeUnix))
val stringified = NonstrictTestsJsonFormat.stringify(Example.serializer(), example)
val stringified = TestsJsonFormat.stringify(Example.serializer(), example)
assertEquals("{\"dateTime\":$dateTimeUnix}", stringified)
val deserialized = NonstrictTestsJsonFormat.parse(Example.serializer(), stringified)
val deserialized = TestsJsonFormat.parse(Example.serializer(), stringified)
assertEquals(example, deserialized)
assertEquals(dateTime, deserialized.dateTime.asDate)