-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feat : added unit tests to project #1
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really good work, you need to do some cleanups.
app/build.gradle
Outdated
} | ||
|
||
dependencies { | ||
compile fileTree(dir: 'libs', include: ['*.jar']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
app/build.gradle
Outdated
compile 'com.jakewharton:butterknife:8.8.1' | ||
annotationProcessor 'com.google.dagger:dagger-compiler:2.10' | ||
androidTestCompile 'com.android.support.test:runner:1.0.2' | ||
testCompile 'org.mockito:mockito-core:2.7.22' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change testCompile
to testImplementation
app/build.gradle
Outdated
annotationProcessor 'com.google.dagger:dagger-compiler:2.10' | ||
androidTestCompile 'com.android.support.test:runner:1.0.2' | ||
testCompile 'org.mockito:mockito-core:2.7.22' | ||
androidTestCompile 'org.mockito:mockito-android:2.7.22' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll need to change this as well, confirm what the newer keyword is.
// Context of the app under test. | ||
Context appContext = InstrumentationRegistry.getTargetContext(); | ||
|
||
assertEquals("com.example.oyeleke.rxjavatest", appContext.getPackageName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Package name is not right
|
||
//test to ensure that when a null user value is changed no interaction takes place in the view | ||
// @Test | ||
// public void noInteractionWithView(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented code
//verify model interactions | ||
verify(mockLoginModel, times(1)).getUser(); | ||
//test fails if the model is called more than once | ||
// verify(mockLoginModel, times(2)).getUser(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented line
.gitignore
Outdated
.gradle | ||
/local.properties | ||
/.idea/workspace.xml | ||
/.idea/libraries |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the entire .idea folder
app/build.gradle
Outdated
android { | ||
compileSdkVersion 27 | ||
defaultConfig { | ||
applicationId "com.example.oyeleke.rxjavatest" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should change the applicationID
@@ -0,0 +1,23 @@ | |||
package com.example.oyeleke.dependencyinjectionandtestdemo.login; | |||
|
|||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove header
Added unit tests by mocking objects using mockito,