-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DEMO dagger2 androidTest #25
Comments
`@Module(includes = {ApplicationModule.class} ) @provides @provides }` |
#25 - change create DaggerMainActivityTest_TestComponent in MockDemoApplication.java after to add ApplicationModule to DemoComponent.java for provide SharedPreferences
#25 - edit creating DemoComponent in DemoApplication.java
#25 - add DgAllEmpsAbsMvvmActivity - add EmptyFragment
ADD Lambda Expression Support
`apply plugin: 'com.android.application' android { compileOptions { |
Add Realm
`dependencies { // Realm |
Add RxJava and RxAndroid
`dependencies { //rxjava
|
#25 - add Realm, RxJava and RxAndroid
#25 - add DgAllEmpsAbsListFragment.java - inject DemoComponent and provide ClockModule.java
#25 - create DgActivityTest.java for DgAllEmpsAbsMvvmActivity.java - new DgMockTestRunner.java, DgMockDemoApplication - in app/build.gradle call new DgMockTestRunner.java TODO - i can not call two TestRunner in build.gradle - change call component in one DemoApplication.java
#25 - i can not call two TestRunner in app/build.gradle I have to change separated createcomponent and createdgcomponent in one DemoApplication.java and one TestRunner
#25 - overriding modules work ok in activity and fragment - attention - what component you inject in activity that component you have to override in tastactivity
|
#25 - override new component in DgAeaActivityTest.java work good TODO - override bind in androidTest because of i want to test and mock only getObservableFBusersRealmEmployee()
#25 - i do not override bind in androidTest because of i want to mock next methods of mViewModel
By http://blog.sqisland.com/2015/04/dagger-2-espresso-2-mockito.html
Github code https://github.com/chiuki/android-test-demo
Override dagger Module by androidTesting. Demo App in folder android-test-demo-master
defaultConfig {
applicationId 'com.sqisland.android.test_demo'
minSdkVersion 8
targetSdkVersion 23
versionCode 1
versionName '1.0.0'
}
In MockTestRunner we call MockDemoApplication.java
app/buld.gradle dependency androidTestAnnotationProcessor "com.google.dagger:dagger-compiler:2.11" for build components and modules in TestActivity for DaggerMainActivityTest_TestComponent.builder().build(); in MockDemoApplication.java
edit Configuration MainActivityTest.java to change TestRunner to MockTestRunner
The text was updated successfully, but these errors were encountered: