-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathHomeActivityEmptyStateTest.kt
38 lines (30 loc) · 1.14 KB
/
HomeActivityEmptyStateTest.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.example.joao.photoscodechallenge.home
import com.example.joao.photoscodechallenge.AcceptanceTest
import com.example.joao.photoscodechallenge.RequestInterceptorMock
import com.example.joao.photoscodechallenge.di.Injector
import com.example.joao.photoscodechallenge.robots.robot
import com.example.joao.photoscodechallenge.ui.MainActivity
import com.example.joao.photoscodechallenge.webservice.exceptions.NoDataException
import com.github.salomonbrys.kodein.Kodein
import com.github.salomonbrys.kodein.bind
import com.github.salomonbrys.kodein.provider
import okhttp3.Interceptor
import org.junit.Test
/**
* Created by Joao Alvares Neto on 07/05/2018.
*/
class HomeActivityEmptyStateTest : AcceptanceTest<MainActivity>(MainActivity::class.java) {
@Test
fun testWithEmptyState() {
startActivity()
robot {
} withEmptyState {
errorHasBeenShown()
}
}
override val testDependencies = Kodein.Module(allowSilentOverride = true) {
bind<Interceptor>(tag = Injector.REQUEST_INTERCEPTOR,overrides = true) with provider {
RequestInterceptorMock(NoDataException())
}
}
}