コード例 #1
0
 @Test
 public void should_create_error_with_StandardRepresentation() {
   Description description = new TestDescription("Test");
   String formattedMessage = "[Test] Hello Yoda";
   when(formatter.format(
           eq(description), any(StandardRepresentation.class), eq("Hello %s"), eq("Yoda")))
       .thenReturn(formattedMessage);
   assertThat(factory.create(description)).isEqualTo(formattedMessage);
 }
コード例 #2
0
 @Test
 public void should_implement_toString() {
   Description description = new TestDescription("Test");
   Representation representation = new StandardRepresentation();
   String formattedMessage = "[Test] Hello Yoda";
   when(formatter.format(description, representation, "Hello %s", "Yoda"))
       .thenReturn(formattedMessage);
   assertThat(factory.create(description, representation)).isEqualTo(formattedMessage);
 }