use of com.facebook.fresco.vito.options.ImageOptions in project fresco by facebook.
the class BitmapDrawableFactoryTest method testCreateDrawable_whenRoundAsCircleAndNativeRounding_thenReturnBitmapDrawable.
@Test
public void testCreateDrawable_whenRoundAsCircleAndNativeRounding_thenReturnBitmapDrawable() {
final CloseableStaticBitmap closeableImage = mock(CloseableStaticBitmap.class);
final Bitmap bitmap = mock(Bitmap.class);
when(closeableImage.getUnderlyingBitmap()).thenReturn(bitmap);
when(closeableImage.getExtras()).thenReturn(mImageExtrasRounded);
final ImageOptions options = mock(ImageOptions.class);
when(options.getRoundingOptions()).thenReturn(RoundingOptions.asCircle());
Drawable drawable = mDrawableFactory.createDrawable(closeableImage, options);
assertThat(drawable).isNotNull();
assertThat(drawable).isInstanceOf(BitmapDrawable.class);
}
use of com.facebook.fresco.vito.options.ImageOptions in project fresco by facebook.
the class BitmapDrawableFactoryTest method testCreateDrawable_whenImageUnknown_thenReturnNull.
@Test
public void testCreateDrawable_whenImageUnknown_thenReturnNull() {
final CloseableImage closeableImage = mock(CloseableImage.class);
final ImageOptions options = mock(ImageOptions.class);
Drawable drawable = mDrawableFactory.createDrawable(closeableImage, options);
assertThat(drawable).isNull();
}
Aggregations