aboutsummaryrefslogtreecommitdiff
path: root/test/src
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-07-11 19:37:02 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-07-11 19:37:02 +0400
commit451b678c6bdff8b8242f299c600d100929a5171f (patch)
tree3c3352b54dcaf332c06aedcdbb11fb6ce0ac868e /test/src
parent73316ee2806eeb5144a43d170a0157ba7164a959 (diff)
downloaddokka-451b678c6bdff8b8242f299c600d100929a5171f.tar.gz
dokka-451b678c6bdff8b8242f299c600d100929a5171f.tar.bz2
dokka-451b678c6bdff8b8242f299c600d100929a5171f.zip
Add processing of classes into model.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/ClassTest.kt43
-rw-r--r--test/src/FunctionTest.kt (renamed from test/src/TopLevelFunctionTest.kt)2
2 files changed, 44 insertions, 1 deletions
diff --git a/test/src/ClassTest.kt b/test/src/ClassTest.kt
new file mode 100644
index 00000000..914df53b
--- /dev/null
+++ b/test/src/ClassTest.kt
@@ -0,0 +1,43 @@
+package com.jetbrains.dokka.tests
+
+import org.junit.Test
+import kotlin.test.*
+import com.jetbrains.dokka.*
+
+public class ClassTest {
+ Test fun emptyClass() {
+ verifyModel("test/data/classes/emptyClass.kt") { model ->
+ val item = model.nodes.single().members.single()
+ assertEquals(DocumentationNodeKind.Class, item.kind)
+ assertEquals("Klass", item.name)
+ assertEquals("", item.doc)
+ assertTrue(item.details.none())
+ assertEquals("<init>", item.members.single().name)
+ assertTrue(item.links.none())
+ }
+ }
+
+ Test fun classWithConstructor() {
+ verifyModel("test/data/classes/classWithConstructor.kt") { model ->
+ val item = model.nodes.single().members.single()
+ assertEquals(DocumentationNodeKind.Class, item.kind)
+ assertEquals("Klass", item.name)
+ assertEquals("", item.doc)
+ assertTrue(item.details.none())
+ assertEquals("<init>", item.members.single().name)
+ assertTrue(item.links.none())
+ }
+ }
+
+ Test fun classWithFunction() {
+ verifyModel("test/data/classes/classWithFunction.kt") { model ->
+ val item = model.nodes.single().members.single()
+ assertEquals(DocumentationNodeKind.Class, item.kind)
+ assertEquals("Klass", item.name)
+ assertEquals("", item.doc)
+ assertTrue(item.details.none())
+ assertEquals("<init>", item.members.single().name)
+ assertTrue(item.links.none())
+ }
+ }
+} \ No newline at end of file
diff --git a/test/src/TopLevelFunctionTest.kt b/test/src/FunctionTest.kt
index 342708f2..e8afe97b 100644
--- a/test/src/TopLevelFunctionTest.kt
+++ b/test/src/FunctionTest.kt
@@ -5,7 +5,7 @@ import kotlin.test.*
import com.jetbrains.dokka.*
-public class TopLevelFunctionTest {
+public class FunctionTest {
Test fun function() {
verifyModel("test/data/functions/function.kt") { model ->
val item = model.nodes.single().members.single()