Code example for List

Methods: contains, size

0
 
        builder.setImageAttachmentsForAction(Arrays.asList(bitmap));
        builder.setImageAttachmentsForObject("foo", Arrays.asList(bitmap));
 
        List<String> attachmentNames = builder.getImageAttachmentNames();
        assertNotNull(attachmentNames);
        assertTrue(attachmentNames.size() == 2);
 
        List<GraphObject> objectImages = object.getImage();
        assertNotNull(objectImages);
        assertTrue(objectImages.size() == 1);
 
        String attachmentName = getAttachmentNameFromContentUri((String) objectImages.get(0).getProperty("url"));
        assertTrue(attachmentNames.contains(attachmentName));
 
        List<JSONObject> actionImages = action.getImage();
        assertNotNull(actionImages);
        assertTrue(actionImages.size() == 1);
 
        attachmentName = getAttachmentNameFromContentUri((String) actionImages.get(0).getString("url"));
        assertTrue(attachmentNames.contains(attachmentName));
    } 
 
    public void testOpenGraphDialogBuilderRequiresAction() { 
        try { 
            FacebookDialog.OpenGraphActionDialogBuilder builder =