aboutsummaryrefslogtreecommitdiff
path: root/test/src/model/ClassTest.kt
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-07-11 20:53:46 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-07-11 20:53:46 +0400
commit6afd7af76563f373e971256f8c9a7dcf42183fd4 (patch)
treeafd350714842b4ec4d9145b8edd43f2962a51290 /test/src/model/ClassTest.kt
parent044308ba60a0d4462ccb7388f16ad17a31d7450d (diff)
downloaddokka-6afd7af76563f373e971256f8c9a7dcf42183fd4.tar.gz
dokka-6afd7af76563f373e971256f8c9a7dcf42183fd4.tar.bz2
dokka-6afd7af76563f373e971256f8c9a7dcf42183fd4.zip
Migrate tests to org.jetbrains.dokka
Diffstat (limited to 'test/src/model/ClassTest.kt')
-rw-r--r--test/src/model/ClassTest.kt123
1 files changed, 123 insertions, 0 deletions
diff --git a/test/src/model/ClassTest.kt b/test/src/model/ClassTest.kt
new file mode 100644
index 00000000..708a1798
--- /dev/null
+++ b/test/src/model/ClassTest.kt
@@ -0,0 +1,123 @@
+package org.jetbrains.dokka.tests
+
+import org.junit.Test
+import kotlin.test.*
+import org.jetbrains.dokka.*
+
+public class ClassTest {
+ Test fun emptyClass() {
+ verifyModel("test/data/classes/emptyClass.kt") { model ->
+ with(model.nodes.single().members.single()) {
+ assertEquals(DocumentationNodeKind.Class, kind)
+ assertEquals("Klass", name)
+ assertEquals("", doc)
+ assertTrue(details.none())
+ assertEquals("<init>", members.single().name)
+ assertTrue(links.none())
+ }
+ }
+ }
+
+ Test fun emptyObject() {
+ verifyModel("test/data/classes/emptyObject.kt") { model ->
+ with(model.nodes.single().members.single()) {
+ assertEquals(DocumentationNodeKind.Object, kind)
+ assertEquals("Obj", name)
+ assertEquals("", doc)
+ assertTrue(details.none())
+ assertTrue(members.none())
+ assertTrue(links.none())
+ }
+ }
+ }
+
+ Test fun classWithConstructor() {
+ verifyModel("test/data/classes/classWithConstructor.kt") { model ->
+ with (model.nodes.single().members.single()) {
+ assertEquals(DocumentationNodeKind.Class, kind)
+ assertEquals("Klass", name)
+ assertEquals("", doc)
+ assertTrue(details.none())
+ assertTrue(links.none())
+
+ assertEquals(1, members.count())
+ with(members.elementAt(0)) {
+ assertEquals("<init>", name)
+ assertEquals("", doc)
+ assertEquals(DocumentationNodeKind.Constructor, kind)
+ assertEquals(1, details.count())
+ with(details.elementAt(0)) {
+ assertEquals("name", name)
+ assertEquals(DocumentationNodeKind.Parameter, kind)
+ assertEquals("", doc)
+ assertTrue(details.none())
+ assertTrue(links.none())
+ assertTrue(members.none())
+ }
+ assertTrue(links.none())
+ assertTrue(members.none())
+ }
+ }
+ }
+ }
+
+ Test fun classWithFunction() {
+ verifyModel("test/data/classes/classWithFunction.kt") { model ->
+ with(model.nodes.single().members.single()) {
+ assertEquals(DocumentationNodeKind.Class, kind)
+ assertEquals("Klass", name)
+ assertEquals("", doc)
+ assertTrue(details.none())
+ assertTrue(links.none())
+
+ assertEquals(2, members.count())
+ with(members.elementAt(0)) {
+ assertEquals("<init>", name)
+ assertEquals("", doc)
+ assertEquals(DocumentationNodeKind.Constructor, kind)
+ assertTrue(details.none())
+ assertTrue(links.none())
+ assertTrue(members.none())
+ }
+ with(members.elementAt(1)) {
+ assertEquals("fn", name)
+ assertEquals("", doc)
+ assertEquals(DocumentationNodeKind.Function, kind)
+ assertTrue(details.none())
+ assertTrue(links.none())
+ assertTrue(members.none())
+ }
+ }
+ }
+ }
+
+ Test fun classWithProperty() {
+ verifyModel("test/data/classes/classWithProperty.kt") { model ->
+ with(model.nodes.single().members.single()) {
+ assertEquals(DocumentationNodeKind.Class, kind)
+ assertEquals("Klass", name)
+ assertEquals("", doc)
+ assertTrue(details.none())
+ assertTrue(links.none())
+
+ assertEquals(2, members.count())
+ with(members.elementAt(0)) {
+ assertEquals("<init>", name)
+ assertEquals("", doc)
+ assertEquals(DocumentationNodeKind.Constructor, kind)
+ assertTrue(details.none())
+ assertTrue(members.none())
+ assertTrue(links.none())
+ }
+ with(members.elementAt(1)) {
+ assertEquals("name", name)
+ assertEquals("", doc)
+ assertEquals(DocumentationNodeKind.Property, kind)
+ assertTrue(details.none())
+ assertTrue(members.none())
+ assertTrue(links.none())
+ }
+ }
+ }
+ }
+} \ No newline at end of file