package com.novoda.imageloader.acceptance;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.test.InstrumentationTestCase;

import com.novoda.imageloader.core.bitmap.BitmapUtil;

public class BitmapUtilsInstrumentationTest extends InstrumentationTestCase {

	public BitmapUtilsInstrumentationTest(String name) {
		super();
		setName(name);
	}
	
	public void testScaleBitmap(){
		Bitmap bmOriginal = BitmapFactory.decodeResource(getInstrumentation().getContext().getResources(), R.drawable.icon);
		assertTrue(bmOriginal.getHeight() <= 72);
		assertTrue(bmOriginal.getWidth() <= 72);
		
		Bitmap bm = new BitmapUtil().decodeResourceBitmapAndScale(getInstrumentation().getContext(), 200, 200, R.drawable.icon, true);		
		
		assertEquals(200, bm.getHeight());
		assertEquals(200, bm.getWidth());
		
		bm = new BitmapUtil().decodeResourceBitmapAndScale(getInstrumentation().getContext(), 200, 200, R.drawable.icon, false);		
		assertEquals(bm, bmOriginal);
	}

	
}

@@ -951,16 +951,17 @@
 lse);%09%09%0A
+%0A
 %09%09assert
@@ -973,20 +973,16 @@
 s(bm
-, bm
 Original
 );%0A%09
@@ -977,16 +977,199 @@
 Original
+.getHeight(), bm.getHeight());%0A%09%09assertEquals(bmOriginal.getWidth(), bm.getWidth());%0A%0A%09%09bm = new BitmapUtil().scaleBitmap(bmOriginal, 200, 200, false);%09%09%0A%09%09assertEquals(bmOriginal, bm
 );%0A%09%7D%0A%0A%09

correct integration test