24 lines
675 B
Kotlin
24 lines
675 B
Kotlin
package io.gitlab.jfronny.commons.serialize.gson.dsl.test
|
|
|
|
import io.gitlab.jfronny.commons.serialize.gson.api.v1.GsonHolders
|
|
import io.gitlab.jfronny.commons.serialize.gson.dsl.jObjectString
|
|
import kotlin.test.Test
|
|
import kotlin.test.assertEquals
|
|
import kotlin.test.assertFalse
|
|
|
|
class DslTest {
|
|
@Test
|
|
fun simpleTest() {
|
|
assertEquals("""{"hi":[["A",12],{"somEVal":true}]}""", jObjectString(GsonHolders.API.gson) {
|
|
jArray("hi") {
|
|
jArray {
|
|
jValue("A")
|
|
jValue(12)
|
|
}
|
|
jObject {
|
|
"somEVal"(true)
|
|
}
|
|
}
|
|
})
|
|
}
|
|
} |