Exemplo n.º 1
0
 @Test
 public void testIsTransformationSet_afterApplyingOptionsWithTransform_isTrue() {
   TestOptions other = new TestOptions();
   other.transform(Bitmap.class, transformation);
   options.apply(other);
   assertThat(options.isTransformationSet()).isTrue();
 }
Exemplo n.º 2
0
 @Test
 public void testApplyingDontTransform_overridesTransformations() {
   options.transform(RuntimeEnvironment.application, transformation);
   options.dontTransform();
   assertThat(options.isTransformationSet()).isFalse();
   assertThat(options.isTransformationRequired()).isFalse();
   assertThat(options.getTransformations()).isEmpty();
 }
Exemplo n.º 3
0
  @Test
  public void testApplyingTransformation_overridesDontTransform() {
    options.dontTransform();
    options.transform(RuntimeEnvironment.application, transformation);

    assertThat(options.isTransformationAllowed()).isTrue();
    assertThat(options.isTransformationRequired()).isTrue();
    assertThat(options.getTransformations()).containsEntry(Bitmap.class, transformation);
  }
Exemplo n.º 4
0
  @Test
  public void testApplyingDefaultOptions_withTransform_retrainsTransform() {
    options.transform(RuntimeEnvironment.application, transformation);
    options.apply(new TestOptions());

    assertThat(options.isTransformationAllowed()).isTrue();
    assertThat(options.isTransformationRequired()).isTrue();
    assertThat(options.getTransformations()).containsEntry(Bitmap.class, transformation);
  }
Exemplo n.º 5
0
  @Test
  public void testApplyingOptions_withDontTransform_overridesTransformations() {
    options.transform(RuntimeEnvironment.application, transformation);
    TestOptions other = new TestOptions();
    other.dontTransform();

    options.apply(other);

    assertThat(options.isTransformationAllowed()).isFalse();
    assertThat(options.isTransformationSet()).isFalse();
    assertThat(options.isTransformationRequired()).isFalse();
    assertThat(options.getTransformations()).isEmpty();
  }