Convert search page test to use new web page test base
[Sone.git] / src / test / kotlin / net / pterodactylus / sone / utils / ObjectsTest.kt
diff --git a/src/test/kotlin/net/pterodactylus/sone/utils/ObjectsTest.kt b/src/test/kotlin/net/pterodactylus/sone/utils/ObjectsTest.kt
new file mode 100644 (file)
index 0000000..1c2d7f5
--- /dev/null
@@ -0,0 +1,23 @@
+package net.pterodactylus.sone.utils
+
+import org.hamcrest.MatcherAssert.assertThat
+import org.hamcrest.Matchers.contains
+import org.hamcrest.Matchers.empty
+import org.junit.Test
+
+/**
+ * Unit test for Object utils.
+ */
+class ObjectsTest {
+
+       @Test
+       fun `non-null value is turned into a list with one element`() {
+               assertThat(5.asList(), contains(5))
+       }
+
+       @Test
+       fun `null value is turned into empty list`() {
+               assertThat(null.asList(), empty())
+       }
+
+}