public @interface TestSpec
For example:
@TestSpec(MyLayoutSpec.class)
public interface TestMyLayoutSpec {}
This will generate a corresponding TestMyLayout class which implements the provided
interface. It contains a Matcher for the properties of the specified MyLayoutSpec
component spec. This can be used in tests as follows:
@Test
public void testMyLayoutSpec() {
final ComponentContext c = mComponentsRule.getContext();
assertThat(c, mComponent)
.has(subComponentWith(c,
TestMyLayoutSpec.matcher(c)
.title(containsString("My Partial Titl"))
.someOtherProperty(14)
.build()));
}
| Modifier and Type | Required Element and Description |
|---|---|
java.lang.Class<?> |
value
A Component Spec class which is annotated with either
LayoutSpec or MountSpec. |
public abstract java.lang.Class<?> value
LayoutSpec or MountSpec.