templates.is_assertion_template.txt Maven / Gradle / Ivy
/**
* Verifies that the actual ${class_to_assert} is ${property}.
* @return this assertion object.
* @throws AssertionError - if the actual ${class_to_assert} is not ${property}.${throws_javadoc}
*/
public ${self_type} is${Property}() ${throws}{
// check that actual ${class_to_assert} we want to make assertions on is not null.
isNotNull();
// check
if (!actual.is${Property}()) {
failWithMessage("\nExpected actual ${class_to_assert} to be ${property} but was not.");
}
// return the current assertion for method chaining
return ${myself};
}
/**
* Verifies that the actual ${class_to_assert} is not ${property}.
* @return this assertion object.
* @throws AssertionError - if the actual ${class_to_assert} is ${property}.${throws_javadoc}
*/
public ${self_type} isNot${Property}() ${throws}{
// check that actual ${class_to_assert} we want to make assertions on is not null.
isNotNull();
// check
if (actual.is${Property}()) {
failWithMessage("\nExpected actual ${class_to_assert} not to be ${property} but was.");
}
// return the current assertion for method chaining
return ${myself};
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy