use of org.androidannotations.ElementValidation in project androidannotations by androidannotations.
the class ValidatorParameterHelperTest method inOrderFail3.
@Test
public void inOrderFail3() throws Exception {
ExecutableElement executableElement = createMethod(boolean.class, boolean.class, long.class, Bundle.class);
ElementValidation valid = new ElementValidation("", executableElement);
//
validator.inOrder().type(boolean.class.getName()).multiple().type(long.class.getName()).optional().type(int.class.getName()).optional().validate(executableElement, valid);
assertFalse(valid.isValid());
}
use of org.androidannotations.ElementValidation in project androidannotations by androidannotations.
the class ValidatorParameterHelperTest method extendsViewType.
@Test
public void extendsViewType() throws Exception {
ExecutableElement executableElement = createMethod(TextView.class);
ElementValidation valid = new ElementValidation("", executableElement);
validator.extendsType(CanonicalNameConstants.VIEW).validate(executableElement, valid);
assertTrue(valid.isValid());
}
use of org.androidannotations.ElementValidation in project androidannotations by androidannotations.
the class ValidatorParameterHelperTest method inOrderSuccess.
@Test
public void inOrderSuccess() throws Exception {
ExecutableElement executableElement = createMethod(boolean.class, int.class);
ElementValidation valid = new ElementValidation("", executableElement);
//
validator.inOrder().type(//
boolean.class.getName()).type(long.class.getName()).optional().type(//
int.class.getName()).validate(executableElement, valid);
assertTrue(valid.isValid());
}
use of org.androidannotations.ElementValidation in project androidannotations by androidannotations.
the class ValidatorParameterHelperTest method inOrderFail4.
@Test
public void inOrderFail4() throws Exception {
ExecutableElement executableElement = createMethod(int.class, long.class, boolean.class);
ElementValidation valid = new ElementValidation("", executableElement);
//
validator.inOrder().type(boolean.class.getName()).optional().type(long.class.getName()).optional().type(int.class.getName()).optional().validate(executableElement, valid);
assertFalse(valid.isValid());
}
use of org.androidannotations.ElementValidation in project androidannotations by androidannotations.
the class ValidatorParameterHelperTest method primitiveParam.
@Test
public void primitiveParam() throws Exception {
ExecutableElement executableElement = createMethod(int.class, Integer.class);
ElementValidation valid = new ElementValidation("", executableElement);
validator.primitiveOrWrapper(TypeKind.INT).multiple().validate(executableElement, valid);
assertTrue(valid.isValid());
}
Aggregations