How do I test that my activity started a service with a particular intent?
My question is similar to Unit testing Activity.startService() call, but I ran into an action bar problem when I used ActivityUnitTestCase.
Here is an example of what I would like to test:
@UiThreadTest
public void testAddSongToAvailableList() {
ListView songList = (ListView) this.getActivity().findViewById(R.id.allSongsList);
songList.getChildAt(0).findViewById(R.id.btnAddToAvailableList).performClick(); // should start my service
//assert that my service was started and is doing stuff
}