1 //---------------------------------------------------------------------------------------
3 // Copyright (c) 2007-2010 by Mulle Kybernetik. See License file for details.
4 //---------------------------------------------------------------------------------------
6 #import <Foundation/Foundation.h>
9 @interface OCMConstraint : NSObject
12 - (BOOL)evaluate:(id)value;
14 // if you are looking for any, isNil, etc, they have moved to OCMArg
16 // try to use [OCMArg checkWith...] instead of the constraintWith... methods below
18 + (id)constraintWithSelector:(SEL)aSelector onObject:(id)anObject;
19 + (id)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue;
24 @interface OCMAnyConstraint : OCMConstraint
27 @interface OCMIsNilConstraint : OCMConstraint
30 @interface OCMIsNotNilConstraint : OCMConstraint
33 @interface OCMIsNotEqualConstraint : OCMConstraint
41 @interface OCMInvocationConstraint : OCMConstraint
44 NSInvocation *invocation;
49 #if NS_BLOCKS_AVAILABLE
51 @interface OCMBlockConstraint : OCMConstraint
56 - (id)initWithConstraintBlock:(BOOL (^)(id))block;
63 #define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self]
64 #define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)]