use of com.facebook.fresco.vito.options.ImageOptionsDrawableFactory in project fresco by facebook.
the class BitmapDrawableFactoryTest method testCreateDrawable_whenRoundAsCircleAndJavaRounding_thenReturnRoundedBitmapDrawable.
@Test
public void testCreateDrawable_whenRoundAsCircleAndJavaRounding_thenReturnRoundedBitmapDrawable() {
final CloseableStaticBitmap closeableImage = mock(CloseableStaticBitmap.class);
final Bitmap bitmap = mock(Bitmap.class);
when(closeableImage.getUnderlyingBitmap()).thenReturn(bitmap);
final ImageOptions options = mock(ImageOptions.class);
when(options.getRoundingOptions()).thenReturn(RoundingOptions.asCircle());
ImageOptionsDrawableFactory factory = new BitmapDrawableFactory(mResources);
Drawable drawable = factory.createDrawable(closeableImage, options);
assertThat(drawable).isNotNull();
assertThat(drawable).isInstanceOf(RoundedBitmapDrawable.class);
}
Aggregations