示例#1
0
 @Koan
 public void insufficientArgumentsToStringFormatCausesAnError() {
   try {
     String.format("%s %s %s", "a", "b");
     fail("No Exception was thrown!");
   } catch (Exception e) {
     assertEquals(e.getClass(), java.util.MissingFormatArgumentException.class);
     assertEquals(e.getMessage(), "Format specifier 's'");
   }
 }
示例#2
0
 @Koan
 public void insufficientArgumentsToStringFormatCausesAnError() {
   try {
     String.format("%s %s %s", "a", "b");
     fail("No Exception was thrown!");
   } catch (Exception e) {
     assertEquals(e.getClass(), __);
     assertEquals(e.getMessage(), __);
   }
 }