March 2015
Beginner to intermediate
274 pages
6h 1m
English
This is a test case designed to test the ContentProvider classes.
The ProviderTestCase2 class also extends AndroidTestCase. The class template parameter T represents ContentProvider under test. Implementation of this test uses IsolatedContext and MockContentResolver, which are mock objects that we described before in this chapter.
There is only one public non-deprecated constructor for this class. This is as follows:
ProviderTestCase2(Class<T> providerClass, String providerAuthority)
This should be invoked with an instance of the ContentProvider class for the same ContentProvider class used as a class template parameter.
The second parameter is the authority for the provider, which is usually defined as ...
Read now
Unlock full access