aboutsummaryrefslogtreecommitdiff
path: root/src/test/kotlin
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2017-10-19 12:10:34 +0200
committerRobert Jaros <rjaros@finn.pl>2017-10-19 12:10:34 +0200
commita043a16a6e9a192e2760d9b43197a9383b7790c2 (patch)
tree1aa942481e3899bddfbcb22a3ddd50b1b5aed6bc /src/test/kotlin
parent3ef71f681eeb1a832bbd0f95d01958617529bae7 (diff)
downloadkvision-a043a16a6e9a192e2760d9b43197a9383b7790c2.tar.gz
kvision-a043a16a6e9a192e2760d9b43197a9383b7790c2.tar.bz2
kvision-a043a16a6e9a192e2760d9b43197a9383b7790c2.zip
Unit tests
Diffstat (limited to 'src/test/kotlin')
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/TestUtil.kt10
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/utils/UtilsSpec.kt19
2 files changed, 29 insertions, 0 deletions
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/TestUtil.kt b/src/test/kotlin/test/pl/treksoft/kvision/TestUtil.kt
index fbda7a45..87c0e87f 100644
--- a/src/test/kotlin/test/pl/treksoft/kvision/TestUtil.kt
+++ b/src/test/kotlin/test/pl/treksoft/kvision/TestUtil.kt
@@ -18,6 +18,16 @@ interface TestSpec {
}
}
+interface SimpleSpec : TestSpec {
+
+ override fun beforeTest() {
+ }
+
+ override fun afterTest() {
+ }
+
+}
+
interface DomSpec : TestSpec {
override fun beforeTest() {
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/utils/UtilsSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/utils/UtilsSpec.kt
new file mode 100644
index 00000000..5ea10c7a
--- /dev/null
+++ b/src/test/kotlin/test/pl/treksoft/kvision/utils/UtilsSpec.kt
@@ -0,0 +1,19 @@
+package test.pl.treksoft.kvision.utils
+
+import pl.treksoft.kvision.utils.Utils
+import test.pl.treksoft.kvision.SimpleSpec
+import kotlin.test.Test
+import kotlin.test.assertEquals
+
+class UtilsSpec : SimpleSpec {
+
+ @Test
+ fun intToHexString() {
+ run {
+ val res = Utils.intToHexString(0xabcdef)
+ assertEquals("abcdef", res, "Should convert int value to hex string")
+ val res2 = Utils.intToHexString(0x123456)
+ assertEquals("123456", res2, "Should convert int value to hex string")
+ }
+ }
+} \ No newline at end of file