Code example for MockContext

0
import jp.mixi.android.sdk.MixiContainer; 
 
public class GroupsProxyImplTest extends AbstractTest { 
     
    public void testGetMyGroups() throws Exception { 
        GetGroupsCallbackHandler handler = new GetGroupsCallbackHandler(new MockContext());
         
        MixiContainer mixiContainer = AndroidMock.createMock(MixiContainer.class);
        mixiContainer.send("/groups/@me", handler);
        AndroidMock.replay(mixiContainer);
         
        GroupsProxyImpl target = new GroupsProxyImpl(mixiContainer);
        target.getMyGroups(handler);
         
        AndroidMock.verify(mixiContainer);
    } 
 
    public void testGetMyGroupsWithParams() throws Exception { 
        GetGroupsCallbackHandler handler = new GetGroupsCallbackHandler(new MockContext());
        Map<String, String> paramMap = new HashMap<String, String>();
        paramMap.put("startIndex", "2");