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
| object EspressoIdlingResource { | |
| private const val RESOURCE = "GLOBAL" | |
| @JvmField val countingIdlingResource = CountingIdlingResource(RESOURCE) | |
| fun increment() { | |
| countingIdlingResource.increment() | |
| } |
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 CameraTest { | |
| @get: Rule | |
| val intentsTestRule = IntentsTestRule(MainActivity::class.java) | |
| @Test | |
| fun test_cameraIntent_isBitmapSetToImageView() { | |
| val activityResult = createWantedImage() | |
| val exceptedIntent: Matcher<Intent> = hasAction(MediaStore.ACTION_IMAGE_CAPTURE) | |
| intending(exceptedIntent).respondWith(activityResult) |
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
| @RunWith(AndroidJUnit4ClassRunner::class) | |
| class GalleryPickerTest { | |
| @get:Rule | |
| val intentTestRule = IntentsTestRule(MainActivity::class.java) | |
| @Test | |
| fun test_validateGalleryIntent() { | |
| val exceptedIntent: Matcher<Intent> = allOf( | |
| hasAction(Intent.ACTION_PICK), |
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
| private fun sendMessage(msg: String?, email: String, password: String) { | |
| errorJob?.cancel() | |
| errorJob = viewModelScope.launch { | |
| msg?.let { | |
| resultEvent.send(ResultEvent.Error(msg)) | |
| } ?: kotlin.run { | |
| //We don't send Success here because We need to check Login | |
| loginUser(email, password) | |
| } | |
| } |