aboutsummaryrefslogtreecommitdiff
path: root/test/src/PropertyTest.kt
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-07-11 20:16:27 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-07-11 20:16:27 +0400
commitf2f6fd9fa48aaa49e16eaa78b86be89e1a232ad7 (patch)
tree0f05fcea870074df16c7d2481ac52476d40c5fd5 /test/src/PropertyTest.kt
parentcc008898485627a805c8275dede9883529712cb9 (diff)
downloaddokka-f2f6fd9fa48aaa49e16eaa78b86be89e1a232ad7.tar.gz
dokka-f2f6fd9fa48aaa49e16eaa78b86be89e1a232ad7.tar.bz2
dokka-f2f6fd9fa48aaa49e16eaa78b86be89e1a232ad7.zip
Add top level property tests.
Diffstat (limited to 'test/src/PropertyTest.kt')
-rw-r--r--test/src/PropertyTest.kt91
1 files changed, 91 insertions, 0 deletions
diff --git a/test/src/PropertyTest.kt b/test/src/PropertyTest.kt
new file mode 100644
index 00000000..6d66af97
--- /dev/null
+++ b/test/src/PropertyTest.kt
@@ -0,0 +1,91 @@
+package com.jetbrains.dokka.tests
+
+import org.junit.Test
+import kotlin.test.*
+import com.jetbrains.dokka.*
+
+
+public class PropertyTest {
+ Test fun valueProperty() {
+ verifyModel("test/data/properties/valueProperty.kt") { model ->
+ with(model.nodes.single().members.single()) {
+ assertEquals("property", name)
+ assertEquals(DocumentationNodeKind.Property, kind)
+ assertEquals("", doc)
+ assertTrue(details.none())
+ assertTrue(members.none())
+ assertTrue(links.none())
+ }
+ }
+ }
+
+ Test fun variableProperty() {
+ verifyModel("test/data/properties/variableProperty.kt") { model ->
+ with(model.nodes.single().members.single()) {
+ assertEquals("property", name)
+ assertEquals(DocumentationNodeKind.Property, kind)
+ assertEquals("", doc)
+ assertTrue(details.none())
+ assertTrue(members.none())
+ assertTrue(links.none())
+ }
+ }
+ }
+
+ Test fun valuePropertyWithGetter() {
+ verifyModel("test/data/properties/valuePropertyWithGetter.kt") { model ->
+ with(model.nodes.single().members.single()) {
+ assertEquals("property", name)
+ assertEquals(DocumentationNodeKind.Property, kind)
+ assertEquals("", doc)
+ assertTrue(details.none())
+ assertTrue(links.none())
+ with(members.single()) {
+ assertEquals("<get-property>", name)
+ assertEquals(DocumentationNodeKind.Function, kind)
+ assertEquals("", doc)
+ assertTrue(details.none())
+ assertTrue(links.none())
+ assertTrue(members.none())
+ }
+ }
+ }
+ }
+
+ Test fun variablePropertyWithAccessors() {
+ verifyModel("test/data/properties/variablePropertyWithAccessors.kt") { model ->
+ with(model.nodes.single().members.single()) {
+ assertEquals("property", name)
+ assertEquals(DocumentationNodeKind.Property, kind)
+ assertEquals("", doc)
+ assertTrue(details.none())
+ assertTrue(links.none())
+
+ assertEquals(2, members.count())
+ with(members.elementAt(0)) {
+ assertEquals("<get-property>", name)
+ assertEquals(DocumentationNodeKind.Function, kind)
+ assertEquals("", doc)
+ assertTrue(details.none())
+ assertTrue(links.none())
+ assertTrue(members.none())
+ }
+ with(members.elementAt(1)) {
+ assertEquals("<set-property>", name)
+ assertEquals(DocumentationNodeKind.Function, kind)
+ assertEquals("", doc)
+ with(details.single()) {
+ assertEquals("value", name)
+ assertEquals(DocumentationNodeKind.Parameter, kind)
+ assertEquals("", doc)
+ assertTrue(details.none())
+ assertTrue(links.none())
+ assertTrue(members.none())
+ }
+ assertTrue(links.none())
+ assertTrue(members.none())
+ }
+ }
+ }
+ }
+}