示例#1
0
  @Test
  public void outputBitmapToFile() {
    File imageFile = new File(generatedImageFilename);

    assertFalse(imageFile.exists());
    bitmap.writeToFile(generatedImageFilename);
    assertTrue(imageFile.exists());

    this.cleanImageFile();
  }
示例#2
0
 @Test
 public void bufferDataCorrespondToImageDimensions() {
   assertEquals(0, bitmap.getDataStart());
   assertEquals(width * height, bitmap.getDataEnd());
 }
示例#3
0
  @Test
  public void createDeepCopyFromOriginalBitmap() {
    SimpleBitmap duplicateBitmap = (SimpleBitmap) bitmap.duplicate();

    assertTrue(bitmap.equals(duplicateBitmap));
  }
示例#4
0
  @Test
  public void twoEqualsImagesAreActuallyEqual() {
    SimpleBitmap equalImage = new SimpleBitmap(originalImageFilename);

    assertTrue(bitmap.equals(equalImage));
  }
示例#5
0
 @Test
 public void readBitmapFromFile() {
   assertNotNull(bitmap);
   assertEquals(width, bitmap.getWidth());
   assertEquals(height, bitmap.getHeight());
 }