use of org.assertj.core.test.Patient in project assertj-core by joel-costigliola.
the class ObjectAssert_isEqualsToComparingFields_Test method should_handle_null_field_with_field_comparator.
@Test
public void should_handle_null_field_with_field_comparator() {
// GIVEN
Patient adam = new Patient(null);
Patient eve = new Patient(new Timestamp(3L));
// THEN
assertThat(adam).usingComparatorForFields(ALWAY_EQUALS, "dateOfBirth").isEqualToComparingFieldByField(eve);
}
use of org.assertj.core.test.Patient in project assertj-core by joel-costigliola.
the class ObjectAssert_isEqualsToComparingFields_Test method should_not_bother_with_comparators_when_fields_are_the_same.
@Test
public void should_not_bother_with_comparators_when_fields_are_the_same() {
// GIVEN
Timestamp dateOfBirth = new Timestamp(3L);
Patient adam = new Patient(dateOfBirth);
Patient eve = new Patient(dateOfBirth);
// THEN
assertThat(adam).usingComparatorForFields(NEVER_EQUALS, "dateOfBirth").isEqualToComparingFieldByField(eve);
}
use of org.assertj.core.test.Patient in project assertj-core by joel-costigliola.
the class Objects_assertIsEqualToComparingFieldByFieldRecursive_Test method should_handle_null_field_with_field_comparator.
@Test
public void should_handle_null_field_with_field_comparator() {
// GIVEN
Patient adam = new Patient(null);
Patient eve = new Patient(new Timestamp(3L));
// THEN
assertThat(adam).usingComparatorForFields(ALWAY_EQUALS, "dateOfBirth", "health").isEqualToComparingFieldByFieldRecursively(eve);
}
use of org.assertj.core.test.Patient in project assertj-core by joel-costigliola.
the class Objects_assertIsEqualToComparingFieldByFieldRecursive_Test method should_not_bother_with_comparators_when_fields_are_the_same.
@Test
public void should_not_bother_with_comparators_when_fields_are_the_same() {
// GIVEN
Timestamp dateOfBirth = new Timestamp(3L);
Patient adam = new Patient(dateOfBirth);
Patient eve = new Patient(dateOfBirth);
// THEN
assertThat(adam).usingComparatorForFields(NEVER_EQUALS, "dateOfBirth").isEqualToComparingFieldByFieldRecursively(eve);
}
use of org.assertj.core.test.Patient in project assertj-core by joel-costigliola.
the class Objects_assertIsEqualToComparingFieldByFieldRecursive_Test method should_handle_null_field_with_type_comparator.
@Test
public void should_handle_null_field_with_type_comparator() {
// GIVEN
Patient adam = new Patient(null);
Patient eve = new Patient(new Timestamp(3L));
// THEN
assertThat(adam).usingComparatorForType(ALWAY_EQUALS_TIMESTAMP, Timestamp.class).isEqualToComparingFieldByFieldRecursively(eve);
}
Aggregations