Package org.assertj.core.presentation

Examples of org.assertj.core.presentation.StandardRepresentation


  @Test
  public void should_format_Object_array_that_has_primitive_array_as_element() {
    boolean booleans[] = { true, false };
    Object[] array = { "Hello", booleans };
    assertEquals("[\"Hello\", [true, false]]", formatter.format(new StandardRepresentation(), array));
  }
View Full Code Here


  @Test
  public void should_format_Object_array_having_itself_as_element() {
    Object[] array1 = { "Hello", "World" };
    Object[] array2 = { array1 };
    array1[1] = array2;
    assertEquals("[[\"Hello\", [...]]]", formatter.format(new StandardRepresentation(), array2));
  }
View Full Code Here

  }

  @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 = elementsShouldHaveAtLeast(newArrayList("Yoda", "Solo", "Leia"), 2, 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<[\"Yoda\", \"Solo\", \"Leia\"]>\n to have at least 2 times <Jedi power>", message);
  }
View Full Code Here

  private static ShouldBeEqual factory;

  @BeforeClass
  public static void setUpOnce() {
    factory = (ShouldBeEqual) shouldBeEqual("Yoda", "Luke", new StandardRepresentation());
  }
View Full Code Here

    assertEqualsIsReflexive(factory);
  }

  @Test
  public void should_have_symmetric_equals() {
    assertEqualsIsSymmetric(factory, shouldBeEqual("Yoda", "Luke", new StandardRepresentation()));
  }
View Full Code Here

    assertEqualsIsSymmetric(factory, shouldBeEqual("Yoda", "Luke", new StandardRepresentation()));
  }

  @Test
  public void should_have_transitive_equals() {
    assertEqualsIsTransitive(factory, shouldBeEqual("Yoda", "Luke", new StandardRepresentation()),
        shouldBeEqual("Yoda", "Luke", new StandardRepresentation()));
  }
View Full Code Here

        shouldBeEqual("Yoda", "Luke", new StandardRepresentation()));
  }

  @Test
  public void should_maintain_equals_and_hashCode_contract() {
    assertMaintainsEqualsAndHashCodeContract(factory, shouldBeEqual("Yoda", "Luke", new StandardRepresentation()));
  }
View Full Code Here

    assertFalse(factory.equals(null));
  }

  @Test
  public void should_not_be_equal_to_IsNotEqual_with_different_actual() {
    assertFalse(factory.equals(shouldBeEqual("Leia", "Luke", new StandardRepresentation())));
  }
View Full Code Here

    assertFalse(factory.equals(shouldBeEqual("Leia", "Luke", new StandardRepresentation())));
  }

  @Test
  public void should_not_be_equal_to_IsNotEqual_with_different_expected() {
    assertFalse(factory.equals(shouldBeEqual("Yoda", "Leia", new StandardRepresentation())));
  }
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.