Created
May 17, 2018 19:01
-
-
Save maskaravivek/fc9abb66e6950470e9cef718635671b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestExamplesApplication : ExamplesApplication() { | |
override fun initAppComponent(): AppComponent { | |
return DaggerAppComponent.builder() | |
.appModule(MockApplicationModule(this)) | |
.build() | |
} | |
@Module | |
private inner class MockApplicationModule internal constructor(application: Application) : AppModule(application) { | |
override fun provideUserService(context: Context): UserService { | |
val mock = Mockito.mock(UserService::class.java) | |
`when`(mock!!.displayUserName("Test")).thenReturn("Hello Test!") | |
return mock | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment