use of org.robolectric.android.CustomStateView in project robolectric by robolectric.
the class ShadowLayoutInflaterTest method shouldConstructCustomViewsWithCustomState.
@Test
public void shouldConstructCustomViewsWithCustomState() throws Exception {
int layoutResId = context.getResources().getIdentifier("custom_layout6", "layout", TEST_PACKAGE);
CustomStateView view = (CustomStateView) LayoutInflater.from(context).inflate(layoutResId, null);
assertThat(view.getDrawableState()).doesNotContain(R.attr.stateFoo);
view.isFoo = true;
view.refreshDrawableState();
assertThat(view.getDrawableState()).contains(R.attr.stateFoo);
}
Aggregations