OCHamcrest
Defines
Logical Matchers
Matcher Library

Boolean logic using other matchers.
More...

Defines

#define allOf   HC_allOf
 allOf(firstMatcher, ...) - Matches if all of the given matchers evaluate to YES.
#define anyOf   HC_anyOf
 anyOf(firstMatcher, ...) - Matches if any of the given matchers evaluate to YES.
#define anything()   HC_anything()
 Matches anything.
#define anythingWithDescription   HC_anythingWithDescription
 anythingWithDescription(description) - Matches anything.
#define isNot   HC_isNot
 isNot(aMatcher) - Inverts the given matcher to its logical negation.

Detailed Description

Boolean logic using other matchers.

Define Documentation

#define allOf   HC_allOf

allOf(firstMatcher, ...) - Matches if all of the given matchers evaluate to YES.

Parameters:
firstMatcher,...A comma-separated list of matchers ending with nil.

The matchers are evaluated from left to right using short-circuit evaluation, so evaluation stops as soon as a matcher returns NO.

Any argument that is not a matcher is implicitly wrapped in an equalTo matcher to check for equality.

(In the event of a name clash, don't #define HC_SHORTHAND and use the synonym HC_allOf instead.)

#define anyOf   HC_anyOf

anyOf(firstMatcher, ...) - Matches if any of the given matchers evaluate to YES.

Parameters:
firstMatcher,...A comma-separated list of matchers ending with nil.

The matchers are evaluated from left to right using short-circuit evaluation, so evaluation stops as soon as a matcher returns YES.

Any argument that is not a matcher is implicitly wrapped in an equalTo matcher to check for equality.

(In the event of a name clash, don't #define HC_SHORTHAND and use the synonym HC_anyOf instead.)

#define anything ( )    HC_anything()

Matches anything.

This matcher always evaluates to YES. Specify this in composite matchers when the value of a particular element is unimportant.

(In the event of a name clash, don't #define HC_SHORTHAND and use the synonym HC_anything instead.)

anythingWithDescription(description) - Matches anything.

Parameters:
descriptionA string used to describe this matcher.

This matcher always evaluates to YES. Specify this in collection matchers when the value of a particular element in a collection is unimportant.

(In the event of a name clash, don't #define HC_SHORTHAND and use the synonym HC_anything instead.)

#define isNot   HC_isNot

isNot(aMatcher) - Inverts the given matcher to its logical negation.

Parameters:
aMatcherThe matcher to negate.

This matcher compares the evaluated object to the negation of the given matcher. If the aMatcher argument is not a matcher, it is implicitly wrapped in an equalTo matcher to check for equality, and thus matches for inequality.

Examples:

(In the event of a name clash, don't #define HC_SHORTHAND and use the synonym HC_isNot instead.)