main
1//
2// Licensed under the terms in License.txt
3//
4// Copyright 2010 Allen Ding. All rights reserved.
5//
6
7#import "KiwiConfiguration.h"
8
9@class KWMessagePattern;
10
11@interface KWStub : NSObject {
12@private
13 KWMessagePattern *messagePattern;
14 id value;
15 id returnValueTimes;
16 int returnedValueTimes;
17 id secondValue;
18 id (^block)(NSArray *params);
19}
20
21#pragma mark -
22#pragma mark Initializing
23
24- (id)initWithMessagePattern:(KWMessagePattern *)aMessagePattern;
25- (id)initWithMessagePattern:(KWMessagePattern *)aMessagePattern value:(id)aValue;
26- (id)initWithMessagePattern:(KWMessagePattern *)aMessagePattern block:(id (^)(NSArray *params))aBlock;
27- (id)initWithMessagePattern:(KWMessagePattern *)aMessagePattern value:(id)aValue times:(id)times afterThatReturn:(id)aSecondValue;
28
29+ (id)stubWithMessagePattern:(KWMessagePattern *)aMessagePattern;
30+ (id)stubWithMessagePattern:(KWMessagePattern *)aMessagePattern value:(id)aValue;
31+ (id)stubWithMessagePattern:(KWMessagePattern *)aMessagePattern block:(id (^)(NSArray *params))aBlock;
32+ (id)stubWithMessagePattern:(KWMessagePattern *)aMessagePattern value:(id)aValue times:(id)times afterThatReturn:(id)aSecondValue;
33
34#pragma mark -
35#pragma mark Properties
36
37@property (nonatomic, readonly) KWMessagePattern *messagePattern;
38@property (nonatomic, readonly) id value;
39@property (nonatomic, readonly) id returnValueTimes;
40@property (nonatomic, readonly) int returnedValueTimes;
41@property (nonatomic, readonly) id secondValue;
42
43#pragma mark -
44#pragma mark Processing Invocations
45
46- (BOOL)processInvocation:(NSInvocation *)anInvocation;
47
48@end