aboutsummaryrefslogtreecommitdiff
path: root/app/src/test/kotlin/com/pitchedapps/frost/facebook/parsers/FbParseTest.kt
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/test/kotlin/com/pitchedapps/frost/facebook/parsers/FbParseTest.kt')
-rw-r--r--app/src/test/kotlin/com/pitchedapps/frost/facebook/parsers/FbParseTest.kt22
1 files changed, 19 insertions, 3 deletions
diff --git a/app/src/test/kotlin/com/pitchedapps/frost/facebook/parsers/FbParseTest.kt b/app/src/test/kotlin/com/pitchedapps/frost/facebook/parsers/FbParseTest.kt
index 3307c72e..075f045e 100644
--- a/app/src/test/kotlin/com/pitchedapps/frost/facebook/parsers/FbParseTest.kt
+++ b/app/src/test/kotlin/com/pitchedapps/frost/facebook/parsers/FbParseTest.kt
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2018 Allan Wang
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
package com.pitchedapps.frost.facebook.parsers
import com.pitchedapps.frost.internal.COOKIE
@@ -24,11 +40,11 @@ class FbParseTest {
}
private inline fun <reified T : Any> FrostParser<T>.test(action: T.() -> Unit = {}) =
- parse(COOKIE).test(url, action)
+ parse(COOKIE).test(url, action)
private inline fun <reified T : Any> ParseResponse<T>?.test(url: String, action: T.() -> Unit = {}) {
val response = this
- ?: fail("${T::class.simpleName} parser returned null for $url")
+ ?: fail("${T::class.simpleName} parser returned null for $url")
println(response)
response.data.action()
}
@@ -58,4 +74,4 @@ class FbParseTest {
}
notifs.map(FrostNotif::time).assertDescending("notif time values")
}
-} \ No newline at end of file
+}