コード例 #1
0
 private static void failNotEqual(
     @Nonnull String[][] actual, @Nonnull String[][] expected, @Nullable Description description) {
   String descriptionValue = description != null ? description.value() : null;
   String message = descriptionValue == null ? "" : String.format("[%s] ", descriptionValue);
   fail(
       message
           + String.format(
               "expected:<%s> but was<%s>", Arrays.format(expected), Arrays.format(actual)));
 }
コード例 #2
0
 /**
  * Formats the given <code>{@link Description}</code> by surrounding its text value with square
  * brackets and adding a space at the end.
  *
  * @param d the description to format. It can be {@code null}.
  * @return the formatted description, or an empty {@code String} if the the {@code Description} is
  *     {@code null}.
  */
 public String format(Description d) {
   String s = (d != null) ? d.value() : null;
   if (isNullOrEmpty(s)) return "";
   return String.format("[%s] ", s);
 }