use of org.robolectric.android.CustomView in project robolectric by robolectric.
the class ShadowLayoutInflaterTest method shouldConstructCustomViewsWithAttributesConstructor.
@Test
public void shouldConstructCustomViewsWithAttributesConstructor() throws Exception {
int layoutResId = context.getResources().getIdentifier("custom_layout", "layout", TEST_PACKAGE);
CustomView view = (CustomView) LayoutInflater.from(context).inflate(layoutResId, null);
assertThat(view.attributeResourceValue).isEqualTo(R.string.hello);
}
use of org.robolectric.android.CustomView in project robolectric by robolectric.
the class ShadowLayoutInflaterTest method shouldConstructCustomViewsWithAttributesInResAutoNamespace.
@Test
public void shouldConstructCustomViewsWithAttributesInResAutoNamespace() throws Exception {
int layoutResId = context.getResources().getIdentifier("custom_layout5", "layout", TEST_PACKAGE);
CustomView view = (CustomView) LayoutInflater.from(context).inflate(layoutResId, null);
assertThat(view.attributeResourceValue).isEqualTo(R.string.hello);
}
use of org.robolectric.android.CustomView in project robolectric by robolectric.
the class ShadowLayoutInflaterTest method shouldConstructCustomViewsWithAttributesWithURLEncodedNamespaces.
@Test
public void shouldConstructCustomViewsWithAttributesWithURLEncodedNamespaces() throws Exception {
int layoutResId = context.getResources().getIdentifier("custom_layout4", "layout", TEST_PACKAGE);
CustomView view = (CustomView) LayoutInflater.from(context).inflate(layoutResId, null).findViewById(R.id.custom_view);
assertThat(view.namespacedResourceValue).isEqualTo(R.layout.text_views);
}
Aggregations