public String getPluralizedActualCount() { return Pluralizer.pluralize(actualCount); } }
public static MockitoAssertionError wantedButNotInvoked(DescribedInvocation wanted, List<? extends DescribedInvocation> invocations) { String allInvocations; if (invocations.isEmpty()) { allInvocations = "Actually, there were zero interactions with this mock.\n"; } else { StringBuilder sb = new StringBuilder( "\nHowever, there " + were_exactly_x_interactions(invocations.size()) + " with this mock:\n"); for (DescribedInvocation i : invocations) { sb.append(i.toString()) .append("\n") .append(i.getLocation()) .append("\n\n"); } allInvocations = sb.toString(); } String message = createWantedButNotInvokedMessage(wanted); return new WantedButNotInvoked(message + allInvocations); }
public String getPluralizedWantedCount() { return Pluralizer.pluralize(wantedCount); }
public String getPluralizedActualCount() { return Pluralizer.pluralize(actualCount); } }
public String getPluralizedWantedCount() { return Pluralizer.pluralize(wantedCount); }
private String createTooManyInvocationsMessage(int wantedCount, int actualCount, DescribedInvocation wanted, Location firstUndesired) { return join( wanted.toString(), "Wanted " + pluralize(wantedCount) + ":", new LocationImpl(), "But was " + pluralize(actualCount) + ". Undesired invocation:", firstUndesired, "" ); }
private static String createTooManyInvocationsMessage(int wantedCount, int actualCount, DescribedInvocation wanted, List<Location> invocations) { return join( wanted.toString(), "Wanted " + pluralize(wantedCount) + ":", new LocationImpl(), "But was " + pluralize(actualCount) + ":", createAllLocationsMessage(invocations), "" ); }
public static MoreThanAllowedActualInvocations wantedAtMostX(int maxNumberOfInvocations, int foundSize) { return new MoreThanAllowedActualInvocations(join("Wanted at most " + pluralize(maxNumberOfInvocations) + " but was " + foundSize)); }
public void wantedAtMostX(int maxNumberOfInvocations, int foundSize) { throw new MockitoAssertionError(join("Wanted at most " + pluralize(maxNumberOfInvocations) + " but was " + foundSize)); }