Package org.assertj.core.internal

Examples of org.assertj.core.internal.ComparatorBasedComparisonStrategy


  @Before
  public void setUp() {
    failures = spy(new Failures());
    arrays = new IntArrays();
    arrays.failures = failures;
    absValueComparisonStrategy = new ComparatorBasedComparisonStrategy(comparatorForCustomComparisonStrategy());
    arraysWithCustomComparisonStrategy = new IntArrays(absValueComparisonStrategy);
    arraysWithCustomComparisonStrategy.failures = failures;
    initActualArray();
  }
View Full Code Here


  }

  @Test
  public void should_create_error_message_with_custom_comparison_strategy() {
    factory = shouldNotContainAtIndex(newArrayList("Yoda", "Luke"), "Luke", atIndex(1),
        new ComparatorBasedComparisonStrategy(CaseInsensitiveStringComparator.instance));
    String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
    assertEquals("[Test] \nExpecting:\n <[\"Yoda\", \"Luke\"]>\nnot to contain:\n <\"Luke\">\n"
        + "at index <1>\n" + "when comparing values using 'CaseInsensitiveStringComparator'", message);
  }
View Full Code Here

  @Before
  public void setUp() {
    failures = spy(new Failures());
    longs = new Longs();
    longs.setFailures(failures);
    absValueComparisonStrategy = new ComparatorBasedComparisonStrategy(new AbsValueComparator<Long>());
    longsWithAbsValueComparisonStrategy = new Longs(absValueComparisonStrategy);
    longsWithAbsValueComparisonStrategy.failures = failures;
  }
View Full Code Here

  @Before
  public void setUp() {
    failures = spy(new Failures());
    arrays = new ByteArrays();
    arrays.failures = failures;
    absValueComparisonStrategy = new ComparatorBasedComparisonStrategy(comparatorForCustomComparisonStrategy());
    arraysWithCustomComparisonStrategy = new ByteArrays(absValueComparisonStrategy);
    arraysWithCustomComparisonStrategy.failures = failures;
    initActualArray();
  }
View Full Code Here

  }

  @Test
  public void should_create_error_message_with_custom_comparison_strategy() {
  factory = shouldNotBeIn("Luke", array("Luke", "Leia"),
                          new ComparatorBasedComparisonStrategy(CaseInsensitiveStringComparator.instance));
  String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
  assertThat(message).isEqualTo("[Test] \n"
                                + "Expecting:\n"
                                + " <\"Luke\">\n"
                                + "not to be in:\n"
View Full Code Here

        + " <[\"Luke\"]>\n", message);
  }

  @Test
  public void should_create_error_message_with_custom_comparison_strategy() {
    factory = shouldContain(newArrayList("Yoda"), newArrayList("Luke", "Yoda"), newLinkedHashSet("Luke"), new ComparatorBasedComparisonStrategy(
        CaseInsensitiveStringComparator.instance));
    String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
    assertEquals("[Test] \nExpecting:\n <[\"Yoda\"]>\nto contain:\n <[\"Luke\", \"Yoda\"]>\nbut could not find:\n"
        + " <[\"Luke\"]>\nwhen comparing values using 'CaseInsensitiveStringComparator'", message);
  }
View Full Code Here

  @Before
  public void setUp() {
    failures = spy(new Failures());
    characters = new Characters();
    characters.failures = failures;
    caseInsensitiveComparisonStrategy = new ComparatorBasedComparisonStrategy(CaseInsensitiveCharacterComparator.instance);
    charactersWithCaseInsensitiveComparisonStrategy = new Characters(caseInsensitiveComparisonStrategy);
    charactersWithCaseInsensitiveComparisonStrategy.failures = failures;
  }
View Full Code Here

  @Before
  public void setUp() {
    failures = spy(new Failures());
    objects = new Objects();
    objects.failures = failures;
    customComparisonStrategy = new ComparatorBasedComparisonStrategy(comparatorForCustomComparisonStrategy());
    objectsWithCustomComparisonStrategy = new Objects(customComparisonStrategy);
    objectsWithCustomComparisonStrategy.failures = failures;
  }
View Full Code Here

    assertEquals("[Test] \nExpecting:\n <[\"Yoda\", \"Luke\"]>\nto end with:\n <[\"Han\", \"Leia\"]>\n", message);
  }

  @Test
  public void should_create_error_message_with_custom_comparison_strategy() {
    factory = shouldEndWith(newArrayList("Yoda", "Luke"), newArrayList("Han", "Leia"), new ComparatorBasedComparisonStrategy(
        CaseInsensitiveStringComparator.instance));
    String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
    assertEquals("[Test] \nExpecting:\n <[\"Yoda\", \"Luke\"]>\nto end with:\n <[\"Han\", \"Leia\"]>\n"
        + "when comparing values using 'CaseInsensitiveStringComparator'", message);
  }
View Full Code Here

  @Test
  public void should_create_error_message_with_custom_comparison_strategy() {
  ErrorMessageFactory factory = shouldNotContain(newArrayList("Yoda"),
                                                 newArrayList("Luke", "Yoda"),
                                                 newLinkedHashSet("Yoda"),
                                                 new ComparatorBasedComparisonStrategy(
                                                                                       CaseInsensitiveStringComparator.instance));
  String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
  assertThat(message).isEqualTo("[Test] \n" +
                                "Expecting\n" +
                                " <[\"Yoda\"]>\n" +
View Full Code Here

TOP

Related Classes of org.assertj.core.internal.ComparatorBasedComparisonStrategy

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.