use of org.assertj.core.test.Person in project assertj-core by joel-costigliola.
the class Objects_assertIsEqualToIgnoringGivenFields_Test method should_pass_when_fields_are_equal_even_if_objects_types_differ.
@Test
public void should_pass_when_fields_are_equal_even_if_objects_types_differ() {
CartoonCharacter actual = new CartoonCharacter("Homer Simpson");
Person other = new Person("Homer Simpson");
objects.assertIsEqualToIgnoringGivenFields(someInfo(), actual, other, noFieldComparators(), defaultTypeComparators(), "children");
}
use of org.assertj.core.test.Person in project assertj-core by joel-costigliola.
the class Objects_assertIsEqualToIgnoringGivenFields_Test method should_pass_when_not_ignored_fields_are_equal_even_if_one_ignored_field_is_not_defined.
@Test
public void should_pass_when_not_ignored_fields_are_equal_even_if_one_ignored_field_is_not_defined() {
Person actual = new Person("Yoda");
Jedi other = new Jedi("Yoda", "Green");
objects.assertIsEqualToIgnoringGivenFields(someInfo(), actual, other, noFieldComparators(), defaultTypeComparators(), "lightSaberColor");
}
use of org.assertj.core.test.Person in project assertj-core by joel-costigliola.
the class Objects_assertIsEqualToIgnoringNullFields_Test method should_pass_when_fields_are_equal_even_if_objects_types_differ.
@Test
public void should_pass_when_fields_are_equal_even_if_objects_types_differ() {
Person actual = new Person("Homer Simpson");
CartoonCharacter other = new CartoonCharacter("Homer Simpson");
objects.assertIsEqualToIgnoringNullFields(someInfo(), actual, other, noFieldComparators(), defaultTypeComparators());
}
use of org.assertj.core.test.Person in project assertj-core by joel-costigliola.
the class Objects_assertSame_Test method should_fail_if_objects_are_not_same.
@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);
failBecauseExpectedAssertionErrorWasNotThrown();
} catch (AssertionError err) {
}
verify(failures).failure(info, shouldBeSame(a, e));
}
use of org.assertj.core.test.Person in project assertj-core by joel-costigliola.
the class Comparables_assertNotEqualByComparison_Test method should_pass_if_objects_are_not_equal_whatever_custom_comparison_strategy_is.
@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);
}
Aggregations