T - The type of the result returned by the operation under testpublic final class Assertion<T> extends Object
Examples:
Testing a value:
public void test() {
new Assertion<>(
"must match the string",
new TextOf("string"),
new TextIs("string")
).affirm(); // value is affirmed
}
Testing an error (see Throws):
public void test() {
new Assertion<>(
"must match the error",
() -> { throw new IllegalArgumentException("error msg"); },
new Throws("error msg", IllegalArgumentException.class)
).affirm(); // error is affirmed
}
public void affirm()
throws AssertionError
AssertionError - if this assertion is refutedCopyright © 2017–2019 jcabi.com. All rights reserved.