forked from Dimrix/android-mvvm-tdd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes.txt
46 lines (33 loc) · 1.75 KB
/
notes.txt
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
39
40
41
42
43
44
45
46
-register
--RegisterActivity
--RegisterScreen
--RegisterViewModel
--RegisterModel
RegisterScreen - dictates the contract the view has to implement
-- write contracts for
RegisterViewModel - saves the state and implements the business logic for registration
-- holds the model
-- provide only getter for the model to prevent direct replacement of model
RegisterModel - holds the registration values and does data validation and api calls
-- write all validation functions in model itself
Testing
1. add testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" to default config
2. add these dependencies to gradle
// Dependencies for local unit tests
testImplementation "junit:junit:4.12"
testImplementation "org.mockito:mockito-all:1.10.19"
testImplementation "org.hamcrest:hamcrest-all:1.3"
testImplementation "org.powermock:powermock-module-junit4:1.6.4"
testImplementation "org.powermock:powermock-api-mockito:1.6.4"
// Android Testing Support Library's runner and rules
androidTestImplementation "com.android.support.test:runner:1.0.1"
androidTestImplementation "com.android.support.test:rules:1.0.1"
// Espresso UI Testing dependencies.
androidTestImplementation "com.android.support.test.espresso:espresso-core:3.0.1"
androidTestImplementation "com.android.support.test.espresso:espresso-contrib:3.0.1"
androidTestImplementation "com.android.support.test.espresso:espresso-intents:3.0.1"
if you have this problem !!! JUnit version 3.8 or later expected:
change JRE version to 1.8 in run configuration
3. add RegisterUnitTest in the test -> java -> com.example.android_mvvm_tdd package
4. add compile "com.google.guava:guava:$rootProject.guavaVersion" for string operations without
android textutils