Code example for MockContentResolver

Methods: insert

0
        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 { 
        ContentValues value = new ContentValues();
        value.put(Registry.NAME, "twitter");
        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");
        try { 
            mResolver.insert(REGISTRY_URI, value);
        } catch (IllegalArgumentException e) {
            assert (true); 
            return; 
        }