Code example for Camera

Methods: getParameters

0
    assertThat(shadowCamera.isLocked()).isTrue();
  } 
 
  @Test 
  public void testGetParameters() throws Exception { 
    Camera.Parameters parameters = camera.getParameters();
    assertThat(parameters).isNotNull();
    assertThat(parameters.getSupportedPreviewFormats()).isNotNull();
    assertThat(parameters.getSupportedPreviewFormats().size()).isNotEqualTo(0);
  } 
 
  @Test 
  public void testSetParameters() throws Exception { 
    Camera.Parameters parameters = camera.getParameters();
    assertThat(parameters.getPreviewFormat()).isEqualTo(ImageFormat.NV21);
    parameters.setPreviewFormat(ImageFormat.JPEG);
    camera.setParameters(parameters);
    assertThat(camera.getParameters().getPreviewFormat()).isEqualTo(ImageFormat.JPEG);
  } 
 
  @Test