Пример #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());
 }