Created
May 2, 2020 06:07
-
-
Save husaynhakeem/895e55b3a6d213d4401eb5f5e7661b36 to your computer and use it in GitHub Desktop.
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
| @Test | |
| fun shouldReceiveData() { | |
| val scenario = FragmentScenario.launchInContainer(FragmentA::class.java) | |
| // Pass data using the parent fragment manager | |
| scenario.onFragment { fragment -> | |
| val data = bundleOf(KEY_DATA to "value") | |
| fragment.parentFragmentManager.setFragmentResult("aKey", data) | |
| } | |
| // Verify data is received, for example, by verifying it's been displayed on the UI | |
| onView(withId(R.id.textView)).check(matches(withText("value"))) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment