Package org.assertj.core.test

Examples of org.assertj.core.test.Person


    comparables.assertNotEqualByComparison(someInfo(), null, 8);
  }

  @Test
  public void should_pass_if_objects_are_not_equal() {
    Person a = spy(new Person("Han"));
    Person o = new Person("Yoda");
    comparables.assertNotEqualByComparison(someInfo(), a, o);
    verify(a).compareTo(o);
  }
View Full Code Here


  // ------------------------------------------------------------------------------------------------------------------

  @Test
  public void should_fail_if_actual_is_null_whatever_custom_comparison_strategy_is() {
    thrown.expectAssertionError(actualIsNull());
    comparablesWithCustomComparisonStrategy.assertNotEqualByComparison(someInfo(), null, new Person("Yoda"));
  }
View Full Code Here

    comparablesWithCustomComparisonStrategy.assertNotEqualByComparison(someInfo(), null, new Person("Yoda"));
  }

  @Test
  public void should_pass_if_objects_are_not_equal_whatever_custom_comparison_strategy_is() {
    Person actual = spy(new Person("YODA"));
    Person other = new Person("Yoda");
    comparablesWithCustomComparisonStrategy.assertNotEqualByComparison(someInfo(), actual, other);
    verify(actual).compareTo(other);
  }
View Full Code Here

  @Test
  public void should_fail_if_objects_are_equal_whatever_custom_comparison_strategy_is() {
    AssertionInfo info = someInfo();
    try {
      comparablesWithCustomComparisonStrategy.assertNotEqualByComparison(info, new Person("Yoda"), new Person("Yoda"));
    } catch (AssertionError e) {
      verify(failures).failure(info, shouldNotBeEqual(new Person("Yoda"), new Person("Yoda")));
      return;
    }
    failBecauseExpectedAssertionErrorWasNotThrown();
  }
View Full Code Here

  private static Person actual;

  @BeforeClass
  public static void setUpOnce() {
    actual = new Person("Yoda");
  }
View Full Code Here

  }

  @Test
  public void should_fail_if_objects_are_same() {
    AssertionInfo info = someInfo();
    Object actual = new Person("Yoda");
    try {
      objects.assertNotSame(info, actual, actual);
    } catch (AssertionError e) {
      verify(failures).failure(info, shouldNotBeSame(actual));
      return;
View Full Code Here

  }

  @Test
  public void should_fail_if_objects_are_not_same() {
    AssertionInfo info = someInfo();
    Object a = new Person("Yoda");
    Object e = new Person("Yoda");
    try {
      objects.assertSame(info, a, e);
      fail();
    } catch (AssertionError err) {}
    verify(failures).failure(info, shouldBeSame(a, e));
View Full Code Here

  private static Person actual;

  @BeforeClass
  public static void setUpOnce() {
    actual = new Person("Yoda");
  }
View Full Code Here

TOP

Related Classes of org.assertj.core.test.Person

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.