Package org.assertj.core.presentation

Examples of org.assertj.core.presentation.StandardRepresentation


  }

  @Test
  public void should_format_float_array() {
    Object array = new float[] { 6.1f, 8.6f };
    assertEquals("[6.1f, 8.6f]", Arrays.format(new StandardRepresentation(), array));
    assertEquals("[6.1f, 8.6f]", Arrays.format(array));
  }
View Full Code Here


  }

  @Test
  public void should_format_int_array() {
    Object array = new int[] { 78, 66 };
    assertEquals("[78, 66]", Arrays.format(new StandardRepresentation(), array));
    assertEquals("[78, 66]", Arrays.format(array));
  }
View Full Code Here

  }

  @Test
  public void should_format_long_array() {
    Object array = new long[] { 160l, 98l };
    assertEquals("[160L, 98L]", Arrays.format(new StandardRepresentation(), array));
    assertEquals("[160L, 98L]", Arrays.format(array));
  }
View Full Code Here

  }

  @Test
  public void should_format_short_array() {
    Object array = new short[] { (short) 5, (short) 8 };
    assertEquals("[5, 8]", Arrays.format(new StandardRepresentation(), array));
    assertEquals("[5, 8]", Arrays.format(array));
  }
View Full Code Here

public class ShouldHaveTime_create_Test {

  @Test
  public void should_create_error_message() throws ParseException {
    Date date = Dates.parseDatetime("2011-01-01T05:01:00");
    String message = shouldHaveTime(date, 123).create(new TextDescription("Test"), new StandardRepresentation());
    assertEquals("[Test] \nExpecting\n <2011-01-01T05:01:00>\nto have time:\n <123L>\nbut was:\n <" + date.getTime() + "L>", message);
  }
View Full Code Here

    factory = elementsShouldNotHave(newArrayList("Yoda", "Luke", "Leia"), newArrayList("Leia"), new TestCondition<String>("jedi power"));
  }

  @Test
  public void should_create_error_message() {
    String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
    assertEquals("[Test] \nExpecting elements:\n<[\"Leia\"]>\n of \n<[\"Yoda\", \"Luke\", \"Leia\"]>\n not to have <jedi power>", message);
  }
View Full Code Here

                                    newLinkedHashSet("jedi"));
  }

  @Test
  public void should_create_error_message() {
    String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
    assertEquals("[Test] \n"
                 + "Expecting:\n"
                 + "  <{\"name\"=\"Yoda\", \"color\"=\"green\"}>\n"
                 + "to contain only following keys:\n"
                 + "  <[\"jedi\", \"color\"]>\n"
View Full Code Here

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

  @Test
  public void should_create_error_message() {
    String message = factory.create(new TestDescription("Test"), new StandardRepresentation());
    assertEquals("[Test] \nExpecting:\n <\"Yoda\">\nto be equal to:\n <\"Luke\">\nignoring case considerations", message);
  }
View Full Code Here

    factoryWithNoOccurence = shouldContainOnlyOnce("aaamodifmoifaabbbmotfaaa", "motif", 0);
  }

  @Test
  public void should_create_error_message_when_string_to_search_appears_several_times() {
    String message = factoryWithSeveralOccurences.create(new TestDescription("Test"), new StandardRepresentation());
    assertEquals(
        "[Test] \nExpecting:\n <\"motif\">\nto appear only once in:\n <\"aaamotifmotifaabbbmotifaaa\">\nbut it appeared 3 times ",
        message);
  }
View Full Code Here

        message);
  }

  @Test
  public void should_create_error_message_when_string_to_search_does_not_appear() {
    String message = factoryWithNoOccurence.create(new TestDescription("Test"), new StandardRepresentation());
    assertEquals(
        "[Test] \nExpecting:\n <\"motif\">\nto appear only once in:\n <\"aaamodifmoifaabbbmotfaaa\">\nbut it did not appear ",
        message);
  }
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.