This file contains hidden or 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
fakeMovieList.forEachIndexed { index, movie -> | |
//Scroll to Position | |
onView(withId(R.id.rvMovie)).perform( | |
RecyclerViewActions.scrollToPosition<RecyclerView.ViewHolder>( | |
index | |
) | |
) | |
if (imageLoader is FakeImageLoader) { |
This file contains hidden or 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
abstract class BaseFragment : Fragment() { | |
override fun onDestroy() { | |
releaseContext(this::class.toString()) | |
super.onDestroy() | |
} | |
} |
This file contains hidden or 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
val myModule = applicationContext { | |
context("A"){ | |
context("B"){ | |
} | |
} | |
context("C"){ | |
} |
This file contains hidden or 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
internal fun stubNews(single: Single<List<NewsModel>> = Single.just(mock())) { | |
whenever(TestApplication.getMockedDataManager().getNews(any())).thenReturn(single) | |
} |
This file contains hidden or 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
val viewModel = viewModelProviders.of(this, newsListingViewModel).get(NewsListingViewModel::class.java) |
This file contains hidden or 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 NewsListingViewModel constructor( | |
val getNews: GetNews | |
) : BaseViewModel() { | |
//Implementations | |
} | |
This file contains hidden or 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
val errorMessageFactory: ErrorMessageFactory by inject() |
This file contains hidden or 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 MyApp : Application() { | |
override fun onCreate() { | |
super.onCreate() | |
startKoin(this, listOf(appModule, persistenceModule, networkModule)) | |
} | |
} |
This file contains hidden or 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 MyApplication : Application(), HasActivityInjector, HasSupportFragmentInjector { | |
@Inject | |
lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector<Activity> | |
@Inject | |
lateinit var dispatchingAndroidFragmentInjector: DispatchingAndroidInjector<Fragment> | |
override fun onCreate() { | |
super.onCreate() | |
DaggerApplicationComponent.builder().application(this).build().inject(this) |
This file contains hidden or 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
@Singleton | |
@Component( | |
modules = arrayOf( | |
AndroidSupportInjectionModule::class, ApplicationModule::class, NetworkModule::class, | |
BindingModule::class | |
) | |
) | |
interface ApplicationComponent { | |
@Component.Builder |