Code example for MockContentResolver

Methods: query

0
    public void testAndroidTestCaseSetupProperly() { 
        super.testAndroidTestCaseSetupProperly(); 
    } 
 
    public void testDBCreation() throws Exception { 
        assertNotNull(mResolver.query(REGISTRY_URI, null, null, null, null));
    } 
 
    public void testSimpleInsertForExternalApplication() throws Exception { 
        ContentValues value = new ContentValues();
        value.put(Registry.NAME, "twitter");
        value.put(Registry.ACCESS_TOKEN_URL, "http://access");
        value.put(Registry.REQUEST_TOKEN_URL, "http://request");
        value.put(Registry.AUTHORIZE_URL, "http://authorize");
        value.put(Registry.CONSUMER_KEY, "key");
        value.put(Registry.CONSUMER_SECRET, "secret");
        assertNotNull(mResolver.insert(REGISTRY_URI, value));
    } 
 
    public void testShouldFailIfNotEnoughtDataProvided() throws Exception {