Package org.assertj.core.presentation

Examples of org.assertj.core.presentation.StandardRepresentation


    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


    factory = shouldHave("Yoda", new TestCondition<String>("green lightsaber"));
  }

  @Test
  public void should_create_error_message() {
    String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
    assertEquals("[Test] \nExpecting:\n <\"Yoda\">\nto have:\n <green lightsaber>", message);
  }
View Full Code Here

  @Test
  public void should_create_error_message() {
    Map<?, ?> map = mapOf(entry("name", "Yoda"), entry("color", "green"));
    ErrorMessageFactory factory = shouldNotContainKey(map, "age");
    String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
    assertEquals("[Test] \nExpecting:\n <{\"name\"=\"Yoda\", \"color\"=\"green\"}>\nnot to contain key:\n <\"age\">", message);
  }
View Full Code Here

                                                            "but had no extension."));
  }

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

  public void should_create_error_message() {
    String[] sequenceValues = { "{", "author", "title", "}" };
    String actual = "{ 'title':'A Game of Thrones', 'author':'George Martin'}";

    factory = shouldContainSequence(actual, sequenceValues, 1);
    String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
    assertEquals("[Test] \nExpecting:\n <\"" + actual + "\">\n"
        + "to contain the following CharSequences in this order:\n"
        + " <[\"{\", \"author\", \"title\", \"}\"]>\n"
        + "but <\"title\"> was found before <\"author\">\n", message);
  }
View Full Code Here

    String[] sequenceValues = { "{", "author", "title", "}" };
    String actual = "{ 'title':'A Game of Thrones', 'author':'George Martin'}";

    factory = shouldContainSequence(actual, sequenceValues, 1,
                                    new ComparatorBasedComparisonStrategy(CaseInsensitiveStringComparator.instance));
    String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
    assertEquals("[Test] \nExpecting:\n <\"" + actual + "\">\n"
        + "to contain the following CharSequences in this order:\n"
        + " <[\"{\", \"author\", \"title\", \"}\"]>\n"
        + "but <\"title\"> was found before <\"author\">\n"
        + "when comparing values using 'CaseInsensitiveStringComparator'", message);
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

    formatter = new ArrayFormatter();
  }

  @Test
  public void should_return_null_if_array_is_null() {
    assertNull(formatter.format(new StandardRepresentation(), null));
  }
View Full Code Here

    assertNull(formatter.format(new StandardRepresentation(), null));
  }

  @Test
  public void should_return_null_if_parameter_is_not_array() {
    assertNull(formatter.format(new StandardRepresentation(), "Hello"));
  }
View Full Code Here

    assertNull(formatter.format(new StandardRepresentation(), "Hello"));
  }

  @Test
  public void should_format_boolean_array() {
    assertEquals("[true, false, true]", formatter.format(new StandardRepresentation(), new boolean[]{true, false, true}));
  }
View Full Code Here

TOP

Related Classes of org.assertj.core.presentation.StandardRepresentation

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.