Package org.assertj.core.presentation

Examples of org.assertj.core.presentation.StandardRepresentation


public class Arrays_format_Test {

  @Test
  public void should_return_null_if_array_is_null() {
    final Object array = null;
    assertNull(Arrays.format(new StandardRepresentation(), array));
    assertNull(Arrays.format(array));
  }
View Full Code Here


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

  @Test
  public void should_create_error_message() {
    String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
    assertEquals("[Test] \nExpecting:\n \"Yoda\"\nnot to match pattern:\n \"Luke\"", message);
  }
View Full Code Here

  }

  @Test
  public void should_return_empty_brackets_if_array_is_empty() {
    final Object[] array = new Object[0];
    assertEquals("[]", Arrays.format(new StandardRepresentation(), array));
    assertEquals("[]", Arrays.format(array));
  }
View Full Code Here

  }

  @Test
  public void should_format_Object_array() {
    Object array = new Object[] { "First", 3 };
    assertEquals("[\"First\", 3]", Arrays.format(new StandardRepresentation(), array));
    assertEquals("[\"First\", 3]", Arrays.format(array));
  }
View Full Code Here

  }

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

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

  @Test
  public void should_create_error_message() {
    String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
    assertEquals("[Test] \nExpecting:\n <\"Luke\">\nand actual:\n <\"Yoda\">\nto refer to the same object", message);
  }
View Full Code Here

  }

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

  }

  @Test
  public void should_format_char_array() {
    Object array = new char[] { 'a', 'b' };
    assertEquals("['a', 'b']", Arrays.format(new StandardRepresentation(), array));
    assertEquals("['a', 'b']", Arrays.format(array));
  }
View Full Code Here

  }

  @Test
  public void should_format_double_array() {
    Object array = new double[] { 6.8, 8.3 };
    assertEquals("[6.8, 8.3]", Arrays.format(new StandardRepresentation(), array));
    assertEquals("[6.8, 8.3]", Arrays.format(array));
  }
View Full Code Here

  @Test
  public void should_create_error_message() throws ParseException {
    ErrorMessageFactory factory = shouldBeInSameHourWindow(parseDatetimeWithMs("2011-01-01T05:00:00.000"),
                                                           parseDatetimeWithMs("2011-01-01T06:05:17.003"));

    String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
    assertThat(message).isEqualTo("[Test] \nExpecting:\n  <2011-01-01T05:00:00>\nto be close to:\n  " +
                                    "<2011-01-01T06:05:17>\n" +
                                    "by less than one hour (strictly) but difference was: 1h 5m 17s and 3ms");
  }
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.