@Test public void testIsTransformationSet_byDefault_isFalse() { assertThat(options.isTransformationSet()).isFalse(); }
@Test public void testIsTransformationSet_afterDontTransform_isFalse() { options.dontTransform(); assertThat(options.isTransformationSet()).isFalse(); }
@Test public void testIsTransformationSet_afterApplyingOptionsWithTransform_isTrue() { RequestOptions other = new RequestOptions(); other.transform(Bitmap.class, transformation); options.apply(other); assertThat(options.isTransformationSet()).isTrue(); }
@Test public void testApplyingDontTransform_overridesTransformations() { options.transform(transformation); options.dontTransform(); assertThat(options.isTransformationSet()).isFalse(); assertThat(options.isTransformationRequired()).isFalse(); assertThat(options.getTransformations()).isEmpty(); }
@Test public void testApplyingOptions_withTransformation_overridesDontTransform() { options.dontTransform(); RequestOptions other = new RequestOptions(); other.transform(transformation); options.apply(other); assertThat(options.isTransformationAllowed()).isTrue(); assertThat(options.isTransformationSet()).isTrue(); assertThat(options.isTransformationRequired()).isTrue(); assertThat(options.getTransformations()).containsEntry(Bitmap.class, transformation); }
@Test public void testApplyingOptions_withDontTransform_overridesTransformations() { options.transform(transformation); RequestOptions other = new RequestOptions(); other.dontTransform(); options.apply(other); assertThat(options.isTransformationAllowed()).isFalse(); assertThat(options.isTransformationSet()).isFalse(); assertThat(options.isTransformationRequired()).isFalse(); assertThat(options.getTransformations()).isEmpty(); }
if (!requestOptions.isTransformationSet() && requestOptions.isTransformationAllowed() && view.getScaleType() != null) {