I have extensive use of ArrayAdapter in my app because most Activities are holding a ListView and I need some custom stuff in them.
I took a look at the test classes in the android developer documentation but wasn’t able to find some examples or a proper testclass…
1) Are there any best practices for (unit)-testing ArrayAdapter in Android?
2) May I have chosen the wrong approach (with the adapters) and killed testability this way?
You can write the test extending
AndroidTestCaseIt will looks something like this:Probably you will have to test
getViewseveral times with different arguments, to test all scenarios.