NetworkImageView extends ImageView { public void setImageUrl(String url, ImageLoader imageLoader) { mUrl = url; mImageLoader = imageLoader; loadImageIfNecessary(false); } NetworkImageView(Context context);  NetworkImageView(Context context, AttributeSet attrs);  NetworkImageView(Context context, AttributeSet attrs, int defStyle); void setImageUrl(String url, ImageLoader imageLoader); void setDefaultImageResId(int defaultImage); void setErrorImageResId(int errorImage);  }
@Test public void setImageUrl_requestsImage() { mNIV.setLayoutParams( new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); mNIV.setImageUrl("http: assertEquals("http: assertEquals(0, mMockImageLoader.lastMaxWidth); assertEquals(0, mMockImageLoader.lastMaxHeight); }
@Test public void setImageUrl_requestsImage() { mNIV.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); mNIV.setImageUrl("http: assertEquals("http: assertEquals(0, mMockImageLoader.lastMaxWidth); assertEquals(0, mMockImageLoader.lastMaxHeight); }