Code example for MockContext

0
 
    @SmallTest 
    public void testPutInvalidTypeThrowsException() { 
        boolean exceptionThrown = false;
        try { 
            ContextTypes.getInstance().put(new MockContext(), -1);
        } catch (IllegalArgumentException e) {
            exceptionThrown = true;
        } 
        assertTrue(exceptionThrown);
    } 
}