KWReceiveMatcher.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //
  2. // Licensed under the terms in License.txt
  3. //
  4. // Copyright 2010 Allen Ding. All rights reserved.
  5. //
  6. #import "KiwiConfiguration.h"
  7. #import "KWCountType.h"
  8. #import "KWMatcher.h"
  9. #import "KWMatchVerifier.h"
  10. @class KWMessagePattern;
  11. @class KWMessageTracker;
  12. @interface KWReceiveMatcher : KWMatcher
  13. @property (nonatomic, assign) BOOL willEvaluateMultipleTimes;
  14. @property (nonatomic, assign) BOOL willEvaluateAgainstNegativeExpectation;
  15. #pragma mark - Configuring Matchers
  16. - (void)receive:(SEL)aSelector;
  17. - (void)receive:(SEL)aSelector withCount:(NSUInteger)aCount;
  18. - (void)receive:(SEL)aSelector withCountAtLeast:(NSUInteger)aCount;
  19. - (void)receive:(SEL)aSelector withCountAtMost:(NSUInteger)aCount;
  20. - (void)receive:(SEL)aSelector andReturn:(id)aValue;
  21. - (void)receive:(SEL)aSelector andReturn:(id)aValue withCount:(NSUInteger)aCount;
  22. - (void)receive:(SEL)aSelector andReturn:(id)aValue withCountAtLeast:(NSUInteger)aCount;
  23. - (void)receive:(SEL)aSelector andReturn:(id)aValue withCountAtMost:(NSUInteger)aCount;
  24. // These methods will become private
  25. - (void)receiveMessagePattern:(KWMessagePattern *)aMessagePattern countType:(KWCountType)aCountType count:(NSUInteger)aCount;
  26. - (void)receiveMessagePattern:(KWMessagePattern *)aMessagePattern andReturn:(id)aValue countType:(KWCountType)aCountType count:(NSUInteger)aCount;
  27. @end
  28. @interface KWMatchVerifier(KWReceiveMatcherAdditions)
  29. #pragma mark - Verifying
  30. - (void)receive:(SEL)aSelector withArguments:(id)firstArgument, ...;
  31. - (void)receive:(SEL)aSelector withCount:(NSUInteger)aCount arguments:(id)firstArgument, ...;
  32. - (void)receive:(SEL)aSelector withCountAtLeast:(NSUInteger)aCount arguments:(id)firstArgument, ...;
  33. - (void)receive:(SEL)aSelector withCountAtMost:(NSUInteger)aCount arguments:(id)firstArgument, ...;
  34. - (void)receive:(SEL)aSelector andReturn:(id)aValue withArguments:(id)firstArgument, ...;
  35. - (void)receive:(SEL)aSelector andReturn:(id)aValue withCount:(NSUInteger)aCount arguments:(id)firstArgument, ...;
  36. - (void)receive:(SEL)aSelector andReturn:(id)aValue withCountAtLeast:(NSUInteger)aCount arguments:(id)firstArgument, ...;
  37. - (void)receive:(SEL)aSelector andReturn:(id)aValue withCountAtMost:(NSUInteger)aCount arguments:(id)firstArgument, ...;
  38. #pragma mark Invocation Capturing Methods
  39. - (id)receive DEPRECATED_ATTRIBUTE;
  40. - (id)receiveWithCount:(NSUInteger)aCount DEPRECATED_ATTRIBUTE;
  41. - (id)receiveWithCountAtLeast:(NSUInteger)aCount DEPRECATED_ATTRIBUTE;
  42. - (id)receiveWithCountAtMost:(NSUInteger)aCount DEPRECATED_ATTRIBUTE;
  43. - (id)receiveAndReturn:(id)aValue DEPRECATED_ATTRIBUTE;
  44. - (id)receiveAndReturn:(id)aValue withCount:(NSUInteger)aCount DEPRECATED_ATTRIBUTE;
  45. - (id)receiveAndReturn:(id)aValue withCountAtLeast:(NSUInteger)aCount DEPRECATED_ATTRIBUTE;
  46. - (id)receiveAndReturn:(id)aValue withCountAtMost:(NSUInteger)aCount DEPRECATED_ATTRIBUTE;
  47. @end