use of org.assertj.core.test.Person in project assertj-core by joel-costigliola.
the class MethodSupport_methodResultFor_Test method setUp.
@Before
public void setUp() {
bruceWayne = new Person("Bruce Wayne");
joker = new Person("Joker");
batman = new SuperHero("Batman", bruceWayne, joker);
}
use of org.assertj.core.test.Person in project assertj-core by joel-costigliola.
the class PropertySupport_publicGetterExistsFor_Test method setUp.
@Before
public void setUp() {
bruceWayne = new Person("Bruce Wayne");
joker = new Person("Joker");
batman = new SuperHero("Batman", bruceWayne, joker);
}
use of org.assertj.core.test.Person in project assertj-core by joel-costigliola.
the class ObjectAssert_isEqualsToComparingFields_Test method should_be_able_to_use_a_type_comparator_for_any_of_the_type_subclasses.
@Test
public void should_be_able_to_use_a_type_comparator_for_any_of_the_type_subclasses() {
JediMaster yoda1 = new JediMaster("Yoda", new Jedi("luke", "Green"));
JediMaster yoda2 = new JediMaster("Yoda", new Jedi("LUKE", null));
// Jedi is a subclass of Person
assertThat(yoda1).usingComparatorForType(new PersonCaseInsensitiveNameComparator(), Person.class).isEqualToComparingFieldByField(yoda2);
assertThat(yoda2).usingComparatorForType(new PersonCaseInsensitiveNameComparator(), Person.class).isEqualToComparingFieldByField(yoda1);
}
use of org.assertj.core.test.Person in project assertj-core by joel-costigliola.
the class Comparables_assertNotEqualByComparison_Test method should_fail_if_actual_is_null_whatever_custom_comparison_strategy_is.
// ------------------------------------------------------------------------------------------------------------------
// tests using a custom comparison strategy
// ------------------------------------------------------------------------------------------------------------------
@Test
public void should_fail_if_actual_is_null_whatever_custom_comparison_strategy_is() {
thrown.expectAssertionError(actualIsNull());
comparablesWithCustomComparisonStrategy.assertNotEqualByComparison(someInfo(), null, new Person("Yoda"));
}
use of org.assertj.core.test.Person in project assertj-core by joel-costigliola.
the class Comparables_assertNotEqualByComparison_Test method should_fail_if_objects_are_equal_whatever_custom_comparison_strategy_is.
@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();
}
Aggregations