Search in sources :

Example 1 with TestShadowProgressBar

use of com.github.ignition.core.test.shadows.TestShadowProgressBar in project ignition by mttkay.

the class RemoteImageViewTest method testCorrectAttributeInflationAndDefaulting.

@Test
public void testCorrectAttributeInflationAndDefaulting() {
    RemoteImageView imageView = (RemoteImageView) activity.findViewById(R.id.image1);
    // default values for unsupplied attributes
    assertTrue(imageView.isAutoLoad());
    Drawable expectedErrorDrawable = Robolectric.application.getResources().getDrawable(RemoteImageView.DEFAULT_ERROR_DRAWABLE_RES_ID);
    assertEquals(expectedErrorDrawable, imageView.getErrorDrawable());
    Drawable expectedProgressDrawable = new TestShadowProgressBar().getIndeterminateDrawable();
    assertEquals(expectedProgressDrawable, imageView.getProgressDrawable());
    assertEquals("http://developer.android.com/images/home/android-design.png", imageView.getImageUrl());
}
Also used : RemoteImageView(com.github.ignition.core.widgets.RemoteImageView) Drawable(android.graphics.drawable.Drawable) TestShadowProgressBar(com.github.ignition.core.test.shadows.TestShadowProgressBar) Test(org.junit.Test)

Aggregations

Drawable (android.graphics.drawable.Drawable)1 TestShadowProgressBar (com.github.ignition.core.test.shadows.TestShadowProgressBar)1 RemoteImageView (com.github.ignition.core.widgets.RemoteImageView)1 Test (org.junit.Test)1