Ejemplo n.º 1
0
  public void testMaxSizeSetAsExtras() {
    builder.withMaxSize(400, 300);

    Intent intent = builder.getIntent(activity);

    assertThat(intent.getIntExtra("max_x", 0)).isEqualTo(400);
    assertThat(intent.getIntExtra("max_y", 0)).isEqualTo(300);
  }
Ejemplo n.º 2
0
  public void testFixedAspectRatioSetAsExtras() {
    builder.asSquare();

    Intent intent = builder.getIntent(activity);

    assertThat(intent.getIntExtra("aspect_x", 0)).isEqualTo(1);
    assertThat(intent.getIntExtra("aspect_y", 0)).isEqualTo(1);
  }
Ejemplo n.º 3
0
  public void testAspectRatioSetAsExtras() {
    builder.withAspect(16, 10);

    Intent intent = builder.getIntent(activity);

    assertThat(intent.getIntExtra("aspect_x", 0)).isEqualTo(16);
    assertThat(intent.getIntExtra("aspect_y", 0)).isEqualTo(10);
  }
Ejemplo n.º 4
0
  public void testBuildsIntentWithMultipleOptions() {
    builder.asSquare().withMaxSize(200, 200);

    Intent intent = builder.getIntent(activity);

    assertThat(intent.getIntExtra("aspect_x", 0)).isEqualTo(1);
    assertThat(intent.getIntExtra("aspect_y", 0)).isEqualTo(1);
    assertThat(intent.getIntExtra("max_x", 0)).isEqualTo(200);
    assertThat(intent.getIntExtra("max_y", 0)).isEqualTo(200);
  }
Ejemplo n.º 5
0
  public void testOutputUriSetAsExtra() {
    Intent intent = builder.getIntent(activity);
    Uri output = intent.getParcelableExtra(MediaStore.EXTRA_OUTPUT);

    assertThat(output.toString()).isEqualTo("image:output");
  }
Ejemplo n.º 6
0
 public void testInputUriSetAsData() {
   ANDROID.assertThat(builder.getIntent(activity)).hasData("image:input");
 }