aboutsummaryrefslogtreecommitdiff
path: root/app/src/test/kotlin/com/pitchedapps
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/test/kotlin/com/pitchedapps')
-rw-r--r--app/src/test/kotlin/com/pitchedapps/frost/facebook/parsers/FbParseTest.kt6
1 files changed, 4 insertions, 2 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 075f045e..4fe43ca8 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
@@ -22,6 +22,7 @@ import com.pitchedapps.frost.internal.assertDescending
import com.pitchedapps.frost.internal.authDependent
import org.junit.BeforeClass
import org.junit.Test
+import kotlin.test.assertFalse
import kotlin.test.assertNotNull
import kotlin.test.assertTrue
import kotlin.test.fail
@@ -39,13 +40,14 @@ class FbParseTest {
}
}
- private inline fun <reified T : Any> FrostParser<T>.test(action: T.() -> Unit = {}) =
+ private inline fun <reified T : ParseData> FrostParser<T>.test(action: T.() -> Unit = {}) =
parse(COOKIE).test(url, action)
- private inline fun <reified T : Any> ParseResponse<T>?.test(url: String, action: T.() -> Unit = {}) {
+ private inline fun <reified T : ParseData> ParseResponse<T>?.test(url: String, action: T.() -> Unit = {}) {
val response = this
?: fail("${T::class.simpleName} parser returned null for $url")
println(response)
+ assertFalse(response.data.isEmpty, "${T::class.simpleName} parser returned empty data for $url")
response.data.action()
}