EXPExpect.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #import <Foundation/Foundation.h>
  2. #import "EXPMatcher.h"
  3. #import "EXPDefines.h"
  4. @interface EXPExpect : NSObject {
  5. EXPIdBlock _actualBlock;
  6. id _testCase;
  7. int _lineNumber;
  8. char *_fileName;
  9. BOOL _negative;
  10. BOOL _asynchronous;
  11. NSTimeInterval _timeout;
  12. }
  13. @property(nonatomic, copy) EXPIdBlock actualBlock;
  14. @property(nonatomic, readonly) id actual;
  15. @property(nonatomic, assign) id testCase;
  16. @property(nonatomic) int lineNumber;
  17. @property(nonatomic) const char *fileName;
  18. @property(nonatomic) BOOL negative;
  19. @property(nonatomic) BOOL asynchronous;
  20. @property(nonatomic) NSTimeInterval timeout;
  21. @property(nonatomic, readonly) EXPExpect *to;
  22. @property(nonatomic, readonly) EXPExpect *toNot;
  23. @property(nonatomic, readonly) EXPExpect *notTo;
  24. @property(nonatomic, readonly) EXPExpect *will;
  25. @property(nonatomic, readonly) EXPExpect *willNot;
  26. @property(nonatomic, readonly) EXPExpect *(^after)(NSTimeInterval timeInterval);
  27. - (instancetype)initWithActualBlock:(id)actualBlock testCase:(id)testCase lineNumber:(int)lineNumber fileName:(const char *)fileName NS_DESIGNATED_INITIALIZER;
  28. + (EXPExpect *)expectWithActualBlock:(id)actualBlock testCase:(id)testCase lineNumber:(int)lineNumber fileName:(const char *)fileName;
  29. - (void)applyMatcher:(id<EXPMatcher>)matcher;
  30. - (void)applyMatcher:(id<EXPMatcher>)matcher to:(NSObject **)actual;
  31. @end
  32. @interface EXPDynamicPredicateMatcher : NSObject <EXPMatcher> {
  33. EXPExpect *_expectation;
  34. SEL _selector;
  35. }
  36. - (instancetype)initWithExpectation:(EXPExpect *)expectation selector:(SEL)selector NS_DESIGNATED_INITIALIZER;
  37. @property (nonatomic, readonly, copy) void (^dispatch)(void);
  38. @end