Code example for Bitmap

Methods: getHeightgetRowBytes

0
        testPersister.removeAllDataFromCache();
        super.tearDown(); 
    } 
 
    private void assertBitmapSizeEquals(int expectedBitmapSize, Bitmap bitmap) {
        assertEquals(expectedBitmapSize, bitmap.getRowBytes() * bitmap.getHeight());
    } 
 
    public void testSaveDataToCache() throws Exception { 
        assertNotNull(testPersister.saveDataToCacheAndReturnData(TEST_BITMAP_LARGE, TEST_CACHE_KEY));
        assertTrue(testPersister.getCacheFile(TEST_CACHE_KEY).exists());
    } 
 
    public void testLoadDataFromCache_no_expiration() throws Exception { 
        testPersister.saveDataToCacheAndReturnData(TEST_BITMAP_LARGE, TEST_CACHE_KEY);
        Bitmap data = testPersister.loadDataFromCache(TEST_CACHE_KEY, DurationInMillis.ALWAYS);
        assertNotNull(data);
        assertBitmapSizeEquals(TEST_BITMAP_LARGE_SIZE, data);
 
    }