@Test public void outputBitmapToFile() { File imageFile = new File(generatedImageFilename); assertFalse(imageFile.exists()); bitmap.writeToFile(generatedImageFilename); assertTrue(imageFile.exists()); this.cleanImageFile(); }
@Test public void bufferDataCorrespondToImageDimensions() { assertEquals(0, bitmap.getDataStart()); assertEquals(width * height, bitmap.getDataEnd()); }
@Test public void createDeepCopyFromOriginalBitmap() { SimpleBitmap duplicateBitmap = (SimpleBitmap) bitmap.duplicate(); assertTrue(bitmap.equals(duplicateBitmap)); }
@Test public void twoEqualsImagesAreActuallyEqual() { SimpleBitmap equalImage = new SimpleBitmap(originalImageFilename); assertTrue(bitmap.equals(equalImage)); }
@Test public void readBitmapFromFile() { assertNotNull(bitmap); assertEquals(width, bitmap.getWidth()); assertEquals(height, bitmap.getHeight()); }