public class HasProperty<T>
extends org.hamcrest.TypeSafeDiagnosingMatcher<T>
| Constructor and Description |
|---|
HasProperty(String property,
org.hamcrest.Matcher<?> matcher) |
| Modifier and Type | Method and Description |
|---|---|
void |
describeTo(org.hamcrest.Description description) |
static <T> org.hamcrest.Matcher<T> |
hasProperty(String property,
org.hamcrest.Matcher<?> matcher)
Creates a matcher that matches if the object being tested has a property anywhere in it's graph and it matches the Matcher
For example:
|
protected boolean |
matchesSafely(T item,
org.hamcrest.Description mismatchDescription) |
public HasProperty(String property, org.hamcrest.Matcher<?> matcher)
public static <T> org.hamcrest.Matcher<T> hasProperty(String property, org.hamcrest.Matcher<?> matcher)
MyObject instance = new MyObject();
assertThat(instance, hasProperty("Name", Matchers.equalTo("Jane"))
property - the property to matchmatcher - the matcher to match withpublic void describeTo(org.hamcrest.Description description)
Copyright © 2015. All rights reserved.