/** * Assembles a failure message and passes such to the FailureStrategy * * @param verb the check being asserted * @param messageParts the expectations against which the subject is compared */ protected final void fail(String verb, Object... messageParts) { StringBuilder message = new StringBuilder("Not true that "); message.append(actualAsString()).append(" ").append(verb); for (Object part : messageParts) { message.append(" <").append(part).append(">"); } failWithoutActual(simpleFact(message.toString())); }
/** * Assembles a failure message and passes it to the FailureStrategy * * @param verb the check being asserted * @param expected the expectations against which the subject is compared * @param failVerb the failure of the check being asserted * @param actual the actual value the subject was compared against */ protected final void failWithBadResults( String verb, Object expected, String failVerb, Object actual) { String message = lenientFormat( "Not true that %s %s <%s>. It %s <%s>", actualAsString(), verb, expected, failVerb, (actual == null) ? "null reference" : actual); failWithoutActual(simpleFact(message)); }