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#import "KWCountType.h"
 9#import "KWMessageSpying.h"
10
11@class KWMessagePattern;
12
13@interface KWMessageTracker : NSObject<KWMessageSpying> {
14@private
15    id subject;
16    KWMessagePattern *messagePattern;
17    KWCountType countType;
18    NSUInteger count;
19    NSUInteger receivedCount;
20}
21
22#pragma mark -
23#pragma mark Initializing
24
25- (id)initWithSubject:(id)anObject messagePattern:(KWMessagePattern *)aMessagePattern countType:(KWCountType)aCountType count:(NSUInteger)aCount;
26
27+ (id)messageTrackerWithSubject:(id)anObject messagePattern:(KWMessagePattern *)aMessagePattern countType:(KWCountType)aCountType count:(NSUInteger)aCount;
28
29#pragma mark -
30#pragma mark Properties
31
32@property (nonatomic, readonly) id subject;
33@property (nonatomic, readonly) KWMessagePattern *messagePattern;
34@property (nonatomic, readonly) KWCountType countType;
35@property (nonatomic, readonly) NSUInteger count;
36
37#pragma mark -
38#pragma mark Stopping Tracking
39
40- (void)stopTracking;
41
42#pragma mark -
43#pragma mark Getting Message Tracker Status
44
45- (BOOL)succeeded;
46
47#pragma mark -
48#pragma mark Getting Phrases
49
50- (NSString *)expectedCountPhrase;
51- (NSString *)receivedCountPhrase;
52
53@end