Package org.assertj.core.internal

Examples of org.assertj.core.internal.TestDescription


    formatter = DescriptionFormatter.instance();
  }

  @Test
  public void should_format_description_if_value_is_not_empty_or_null() {
    assertEquals("[Leia] ", formatter.format(new TestDescription("Leia")));
  }
View Full Code Here


    factory = shouldNotBeNull();
  }

  @Test
  public void should_create_error_message() {
    String message = factory.create(new TestDescription("Test"), new StandardRepresentation());
    assertEquals("[Test] \nExpecting actual not to be null", message);
  }
View Full Code Here

  private ShouldBeEqual factory;
  private ConstructorInvoker constructorInvoker;

  @Before
  public void setUp() {
    description = new TestDescription("Jedi");
    factory = (ShouldBeEqual) shouldBeEqual("Luke", "Yoda", new StandardRepresentation());
    constructorInvoker = mock(ConstructorInvoker.class);
    factory.constructorInvoker = constructorInvoker;
  }
View Full Code Here

    factory = shouldHaveSameClass("Yoda", 10L);
  }

  @Test
  public void should_create_error_message() {
    String message = factory.create(new TestDescription("Test"), new StandardRepresentation());
    assertEquals(
        "[Test] \nExpecting\n <\"Yoda\">\nto have the same class as:\n <10L>(<java.lang.Long>) \nbut its class was:<java.lang.String>", message);
  }
View Full Code Here

    factory = shouldNotHaveSameClass("Yoda", "Luke");
  }

  @Test
  public void should_create_error_message() {
    String message = factory.create(new TestDescription("Test"), new StandardRepresentation());
    assertEquals("[Test] \nExpecting:\n <\"Yoda\">\nnot to have not the same class as:\n <\"Luke\"> (java.lang.String)", message);
  }
View Full Code Here

  private final Description description;

  @Parameters
  public static List<Object[]> parameters() {
    return newArrayList(new Object[][] { { null }, { new TestDescription(null) }, { new TestDescription("") } });
  }
View Full Code Here

                                                            "  <\"" + expectedExtension + "\">%n" +
                                                            "but had no extension."));
  }

  private String createMessage(String actualExtension) {
    return shouldHaveExtension(actual, actualExtension, expectedExtension).create(new TestDescription("TEST"),
        new StandardRepresentation());
  }
View Full Code Here

    factory = shouldNotBeSame("Yoda");
  }

  @Test
  public void should_create_error_message() {
    String message = factory.create(new TestDescription("Test"), new StandardRepresentation());
    assertEquals("[Test] \nExpected not same:<\"Yoda\">", message);
  }
View Full Code Here

    factory.formatter = formatter;
  }

  @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);
    assertEquals(formattedMessage, factory.create(description, representation));
  }
View Full Code Here

    factory = shouldBeOfClassIn("Yoda", newArrayList(Long.class, File.class));
  }

  @Test
  public void should_create_error_message() {
    String message = factory.create(new TestDescription("Test"), new StandardRepresentation());
    assertEquals("[Test] \nExpecting:\n <\"Yoda\">\nto be of one these types:\n <[java.lang.Long, java.io.File]>\nbut was:\n <java.lang.String>",
        message);
  }
View Full Code Here

TOP

Related Classes of org.assertj.core.internal.TestDescription

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.