File tree Expand file tree Collapse file tree 3 files changed +7
-8
lines changed
main/kotlin/com/mvcoding/mvp
test/kotlin/com/mvcoding/mvp Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import rx.Observable
4
4
import rx.Subscription
5
5
import rx.subscriptions.CompositeSubscription
6
6
7
- abstract class Presenter <VIEW : View > {
7
+ abstract class Presenter <VIEW : Presenter . View > {
8
8
private lateinit var viewSubscriptions: CompositeSubscription
9
9
private var view: View ? = null
10
10
@@ -44,4 +44,6 @@ abstract class Presenter<VIEW : View> {
44
44
else if (this .view != view)
45
45
throw IllegalStateException (" Trying to detach different view. We have view: ${this .view} . Trying to detach view: $view " )
46
46
}
47
+
48
+ interface View
47
49
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ import rx.Observable.just
8
8
import kotlin.test.assertFalse
9
9
10
10
class PresenterTest {
11
- val view = mock<View >()
12
- val presenter: Presenter <View > = object : Presenter <View >() {
11
+ val view = mock<Presenter . View >()
12
+ val presenter: Presenter <Presenter . View > = object : Presenter <Presenter . View >() {
13
13
}
14
14
15
15
@Test(expected = IllegalStateException ::class )
@@ -33,7 +33,7 @@ class PresenterTest {
33
33
@Test(expected = IllegalStateException ::class )
34
34
fun throwsIllegalStateExceptionWhenTryingToDetachDifferentView () {
35
35
presenter.attach(view)
36
- presenter.detach(mock<View >())
36
+ presenter.detach(mock<Presenter . View >())
37
37
}
38
38
39
39
@Test
@@ -50,7 +50,7 @@ class PresenterTest {
50
50
assertFalse { isSubscribed }
51
51
}
52
52
53
- interface ViewForTest : View {
53
+ interface ViewForTest : Presenter . View {
54
54
fun events (): Observable <Unit >
55
55
}
56
56
You can’t perform that action at this time.
0 commit comments