Code example for MockContentResolver

Methods: insertqueryupdate

0
        value.put(Registry.AUTHORIZE_URL, "http://authorize");
        value.put(Registry.CONSUMER_KEY, "key");
        value.put(Registry.CONSUMER_SECRET, "secret123");
        value.put(Registry.URL, "http://twitter.com");
 
        Uri uri = mResolver.insert(REGISTRY_URI, value);
        assertNotNull(uri);
 
        value.clear();
        value.put(Registry.ACCESS_SECRET, "mysec");
        value.put(Registry.ACCESS_TOKEN, "mytok");
        assertEquals(1, mResolver.update(uri, value, null, null));
 
        Cursor cur = mResolver.query(uri, new String[] {
                Registry.ACCESS_SECRET, Registry.ACCESS_TOKEN 
        }, null, null, null); 
         
        assertTrue(cur.moveToFirst());
        assertEquals("mysec", cur.getString(cur.getColumnIndexOrThrow(Registry.ACCESS_SECRET)));
        assertEquals("mytok", cur.getString(cur.getColumnIndexOrThrow(Registry.ACCESS_TOKEN)));
Connect your IDE to all the code out there  Get Codota for Java