I have a button in a FragmentActivity which, when pressed should open a DialogFragment.
I want to test that it works using JUnit for Android in Eclipse.
With an Activity I could use ActivityMonitor. How can I test that the correct Fragment has opened when the button is clicked?
Assuming you are opening your dialog fragment sort of like this:
you can check that it’s up & showing by doing this in your test case: