KWStub.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // Licensed under the terms in License.txt
  3. //
  4. // Copyright 2010 Allen Ding. All rights reserved.
  5. //
  6. #import "KiwiConfiguration.h"
  7. @class KWMessagePattern;
  8. @interface KWStub : NSObject
  9. #pragma mark - Initializing
  10. - (id)initWithMessagePattern:(KWMessagePattern *)aMessagePattern;
  11. - (id)initWithMessagePattern:(KWMessagePattern *)aMessagePattern value:(id)aValue;
  12. - (id)initWithMessagePattern:(KWMessagePattern *)aMessagePattern block:(id (^)(NSArray *params))aBlock;
  13. - (id)initWithMessagePattern:(KWMessagePattern *)aMessagePattern value:(id)aValue times:(id)times afterThatReturn:(id)aSecondValue;
  14. + (id)stubWithMessagePattern:(KWMessagePattern *)aMessagePattern;
  15. + (id)stubWithMessagePattern:(KWMessagePattern *)aMessagePattern value:(id)aValue;
  16. + (id)stubWithMessagePattern:(KWMessagePattern *)aMessagePattern block:(id (^)(NSArray *params))aBlock;
  17. + (id)stubWithMessagePattern:(KWMessagePattern *)aMessagePattern value:(id)aValue times:(id)times afterThatReturn:(id)aSecondValue;
  18. #pragma mark - Properties
  19. @property (nonatomic, readonly) KWMessagePattern *messagePattern;
  20. @property (nonatomic, readonly) id value;
  21. @property (nonatomic, readonly) id returnValueTimes;
  22. @property (nonatomic, readonly) int returnedValueTimes;
  23. @property (nonatomic, readonly) id secondValue;
  24. #pragma mark - Processing Invocations
  25. - (BOOL)processInvocation:(NSInvocation *)anInvocation;
  26. @end