public void test_ignores_different_properties() { final ExampleBean differentBean = new ExampleBean("different", 1, aValue); assertMatches("different property", samePropertyValuesAs(expectedBean, "stringProperty"), differentBean); }
public void test_reports_mismatch_on_first_property_difference() { assertMismatchDescription("stringProperty was \"different\"", samePropertyValuesAs(expectedBean), new ExampleBean("different", 1, aValue)); assertMismatchDescription("intProperty was <2>", samePropertyValuesAs(expectedBean), new ExampleBean("same", 2, aValue)); assertMismatchDescription("valueProperty was <Value other>", samePropertyValuesAs(expectedBean), new ExampleBean("same", 1, new Value("other"))); }
public void test_can_ignore_all_properties() { final ExampleBean differentBean = new ExampleBean("different", 2, new Value("not expected")); assertMatches( "different property", samePropertyValuesAs(expectedBean, "stringProperty", "intProperty", "valueProperty"), differentBean); }