Use bucket parameter in GetIfChanged for support binaries.
[chromium-blink-merge.git] / third_party / ocmock / OCMock / OCMConstraint.h
blob3ae1264603843afd648aa98f6d9d2108fe778dab
1 //---------------------------------------------------------------------------------------
2 // $Id$
3 // Copyright (c) 2007-2010 by Mulle Kybernetik. See License file for details.
4 //---------------------------------------------------------------------------------------
6 #import <Foundation/Foundation.h>
9 @interface OCMConstraint : NSObject
11 + (id)constraint;
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;
22 @end
24 @interface OCMAnyConstraint : OCMConstraint
25 @end
27 @interface OCMIsNilConstraint : OCMConstraint
28 @end
30 @interface OCMIsNotNilConstraint : OCMConstraint
31 @end
33 @interface OCMIsNotEqualConstraint : OCMConstraint
35 @public
36 id testValue;
39 @end
41 @interface OCMInvocationConstraint : OCMConstraint
43 @public
44 NSInvocation *invocation;
47 @end
49 #if NS_BLOCKS_AVAILABLE
51 @interface OCMBlockConstraint : OCMConstraint
53 BOOL (^block)(id);
56 - (id)initWithConstraintBlock:(BOOL (^)(id))block;
58 @end
60 #endif
63 #define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self]
64 #define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)]