aboutsummaryrefslogtreecommitdiff
path: root/app/src/androidTest/kotlin/com/pitchedapps
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/androidTest/kotlin/com/pitchedapps')
-rw-r--r--app/src/androidTest/kotlin/com/pitchedapps/frost/activities/ImageActivityTest.kt6
-rw-r--r--app/src/androidTest/kotlin/com/pitchedapps/frost/facebook/FbCookieTest.kt18
2 files changed, 20 insertions, 4 deletions
diff --git a/app/src/androidTest/kotlin/com/pitchedapps/frost/activities/ImageActivityTest.kt b/app/src/androidTest/kotlin/com/pitchedapps/frost/activities/ImageActivityTest.kt
index 23f6dab9..d32b956e 100644
--- a/app/src/androidTest/kotlin/com/pitchedapps/frost/activities/ImageActivityTest.kt
+++ b/app/src/androidTest/kotlin/com/pitchedapps/frost/activities/ImageActivityTest.kt
@@ -62,14 +62,14 @@ class ImageActivityTest {
}
private val mockServer: MockWebServer by lazy {
- val magentaImg = Buffer()
- magentaImg.writeAll(Okio.source(getResource("bayer-pattern.jpg")))
+ val img = Buffer()
+ img.writeAll(Okio.source(getResource("bayer-pattern.jpg")))
MockWebServer().apply {
setDispatcher(object : Dispatcher() {
override fun dispatch(request: RecordedRequest): MockResponse =
when {
request.path.contains("text") -> MockResponse().setResponseCode(200).setBody("Valid mock text response")
- request.path.contains("image") -> MockResponse().setResponseCode(200).setBody(magentaImg)
+ request.path.contains("image") -> MockResponse().setResponseCode(200).setBody(img)
else -> MockResponse().setResponseCode(404).setBody("Error mock response")
}
})
diff --git a/app/src/androidTest/kotlin/com/pitchedapps/frost/facebook/FbCookieTest.kt b/app/src/androidTest/kotlin/com/pitchedapps/frost/facebook/FbCookieTest.kt
index d5c8d2e1..a826391e 100644
--- a/app/src/androidTest/kotlin/com/pitchedapps/frost/facebook/FbCookieTest.kt
+++ b/app/src/androidTest/kotlin/com/pitchedapps/frost/facebook/FbCookieTest.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
import android.webkit.CookieManager
@@ -10,4 +26,4 @@ class FbCookieTest {
fun managerAcceptsCookie() {
assertTrue(CookieManager.getInstance().acceptCookie(), "Cookie manager should accept cookie by default")
}
-} \ No newline at end of file
+}