26272829303132333435
*/ public class ErrorMessageTest { @Test public void testGetters() { final ErrorMessage m = new ErrorMessage(true, "error", 3); assertTrue(m.isMatching()); assertEquals("error", m.getMessage()); assertEquals(3, m.getActualCount()); }
353637383940414243
} @Test public void testAppendTo_matchingOne() { final StringBuilder sb = new StringBuilder(20); final ErrorMessage m = new ErrorMessage(true, "error()", 2); m.appendTo(sb, 1); assertEquals("\n error(), actual: 3", sb.toString()); }
434445464748495051
} @Test public void testAppendTo_matchingNone() { final StringBuilder sb = new StringBuilder(20); final ErrorMessage m = new ErrorMessage(false, "error()", 2); m.appendTo(sb, 0); assertEquals("\n error(), actual: 2", sb.toString()); }
515253545556575859
} @Test public void testAppendTo_matchingMultiple() { final StringBuilder sb = new StringBuilder(20); final ErrorMessage m = new ErrorMessage(true, "error()", 2); m.appendTo(sb, 2); assertEquals("\n error(), actual: 2 (+1)", sb.toString()); }