In the test project for my android app I initially had a series of test for several low level classes. By low level I mean that they are not activities, services or anything specific. They are just classes performing some work according to specs. They relay though on some information from the app context - database, some resources etc.
All tests were green and I was happy. After I added another test class to the lineup to test an Activity all of the sudden my green test started to fail. The Activity tests I added are green but some of the tests which used to be green now throw an exception.
From the dalvik trace it looks like that although my used-to-be green tests do not need anything but the application context, the system still tries to resume some activity (not the one I was trying to unit test with the new tests).
So here is my question: how can I unit test a class which needs just the application context but nothing else? How can I prevent the runtime from trying to launch activities I care nothing about?