Merge pull request #20 from Zelenyy/dev-zelenyy

Two test for checking Meta.enum extension.
This commit is contained in:
Alexander Nozik 2019-10-07 12:06:31 +03:00 committed by GitHub
commit 6d52db311d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,22 @@
package hep.dataforge.meta
import org.junit.Test
class MetaExtensionTest {
enum class TestEnum{
test
}
@Test
fun testEnum(){
val meta = buildMeta{"enum" to TestEnum.test}
meta["enum"].enum<TestEnum>()
}
@Test
fun testEnumByString(){
val meta = buildMeta{"enum" to TestEnum.test.toString()}
println(meta["enum"].enum<TestEnum>())
}
}