Examples of TestDescription


Examples of org.assertj.core.internal.TestDescription

  @Test
  public void should_create_error_message_with_private_static_comparator() {
    ErrorMessageFactory factory = shouldBeSortedAccordingToGivenComparator(1, array("b", "c", "a"),
        new StaticStringComparator());
    String message = factory.create(new TestDescription("Test"), new StandardRepresentation());
    assertEquals(
        "[Test] \ngroup is not sorted according to 'StaticStringComparator' comparator because element 1:\n <\"c\">\nis not less or equal than element 2:\n <\"a\">\ngroup was:\n <[\"b\", \"c\", \"a\"]>",
        message);
  }
View Full Code Here

Examples of org.assertj.core.internal.TestDescription

    factory = shouldNotBeInstanceOfAny("Yoda", types);
  }

  @Test
  public void should_create_error_message() {
    String message = factory.create(new TestDescription("Test"), new StandardRepresentation());
    assertEquals("[Test] \nExpecting:\n <\"Yoda\">\nnot to be an instance of any of these types:\n <[java.lang.String, java.lang.Object]>", message);
  }
View Full Code Here

Examples of org.assertj.core.internal.TestDescription

    assertEquals("my message", failure.getMessage());
  }

  @Test
  public void should_use_ErrorMessage_when_overriding_error_message_is_not_specified() {
    Description description = new TestDescription("description");
    info.description(description);
    when(errorMessage.create(description, info.representation())).thenReturn("[description] my message");
    AssertionError failure = failures.failure(info, errorMessage);
    assertEquals("[description] my message", failure.getMessage());
  }
View Full Code Here

Examples of org.assertj.core.internal.TestDescription

  }

  @Test
  public void should_use_AssertionErrorFactory_when_overriding_error_message_is_not_specified() {
    MyOwnAssertionError expectedError = new MyOwnAssertionError("[description] my message");
    Description description = new TestDescription("description");
    info.description(description);
    when(errorFactory.newAssertionError(description, info.representation())).thenReturn(expectedError);
    AssertionError failure = failures.failure(info, errorFactory);
    assertSame(expectedError, failure);
  }
View Full Code Here

Examples of org.assertj.core.internal.TestDescription

  private static Description description;

  @BeforeClass
  public static void setUpOnce() {
    description = new TestDescription(someTextDescription());
  }
View Full Code Here

Examples of org.assertj.core.internal.TestDescription

  private static Description description;

  @BeforeClass
  public static void setUpOnce() {
    description = new TestDescription(someTextDescription());
  }
View Full Code Here

Examples of org.fest.assertions.internal.TestDescription

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

  @Test
  public void should_create_error_message() {
    String message = factory.create(new TestDescription("Jedi"));
    assertEquals("[Jedi] expecting:\n<'Yoda'> should not be equal to:<'Luke'>", message);
  }
View Full Code Here

Examples of org.fest.assertions.internal.TestDescription

  private final String formattedDescription = "[Jedi]";
  private Description description;

  @Before
  public void setUp() {
    description = new TestDescription("Jedi");
  }
View Full Code Here

Examples of org.fest.assertions.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

Examples of org.fest.assertions.internal.TestDescription

    factory = shouldBeSorted(1, array("b", "c", "a"));
  }

  @Test
  public void should_create_error_message() {
    String message = factory.create(new TestDescription("Test"));
    assertEquals("[Test] group is not sorted because element 1:<'c'> is not less or equal than element 2:<'a'>.\n"
        + "group was:\n" + "<['b', 'c', 'a']>", message);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.