-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBobTest.m
132 lines (111 loc) · 3.74 KB
/
BobTest.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#import <XCTest/XCTest.h>
#import "Bob.h"
@interface test_suite : XCTestCase
@end
@implementation test_suite
- (Bob *)bob {
return [[Bob alloc] init];
}
- (void)testStatingSomething {
NSString *input = @"Tom-ay-to, tom-aaaah-to.";
NSString *expected = @"Whatever.";
NSString *result = [[self bob] hey:input];
XCTAssertEqualObjects(expected, result, @"");
}
- (void)testShouting {
NSString *input = @"WATCH OUT!";
NSString *expected = @"Woah, chill out!";
NSString *result = [[self bob] hey:input];
XCTAssertEqualObjects(expected, result, @"");
}
- (void)testAskingAQuestion {
NSString *input = @"Does this cryogenic chamber make me look fat?";
NSString *expected = @"Sure.";
NSString *result = [[self bob] hey:input];
XCTAssertEqualObjects(expected, result, @"");
}
- (void)testTalkingForcefully {
NSString *input = @"Let's go make out behind the gym!";
NSString *expected = @"Whatever.";
NSString *result = [[self bob] hey:input];
XCTAssertEqualObjects(expected, result, @"");
}
- (void)testUsingAcronyms {
NSString *input = @"It's OK if you don't want to go to the DMV.";
NSString *expected = @"Whatever.";
NSString *result = [[self bob] hey:input];
XCTAssertEqualObjects(expected, result, @"");
}
- (void)testForcefulQuestions {
NSString *input = @"WHAT THE HELL WERE YOU THINKING?";
NSString *expected = @"Woah, chill out!";
NSString *result = [[self bob] hey:input];
XCTAssertEqualObjects(expected, result, @"");
}
- (void)testShoutingNumbers {
NSString *input = @"1, 2, 3 GO!";
NSString *expected = @"Woah, chill out!";
NSString *result = [[self bob] hey:input];
XCTAssertEqualObjects(expected, result, @"");
}
- (void)testOnlyNumbers {
NSString *input = @"1, 2, 3.";
NSString *expected = @"Whatever.";
NSString *result = [[self bob] hey:input];
XCTAssertEqualObjects(expected, result, @"");
}
- (void)testQuestionWithOnlyNumbers {
NSString *input = @"4?";
NSString *expected = @"Sure.";
NSString *result = [[self bob] hey:input];
XCTAssertEqualObjects(expected, result, @"");
}
- (void)testShoutingWithSpecialCharacters {
NSString *input = @"ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!";
NSString *expected = @"Woah, chill out!";
NSString *result = [[self bob] hey:input];
XCTAssertEqualObjects(expected, result, @"");
}
- (void)testShoutingWithUmlautsCharacters {
NSString *input = @"ÄMLÄTS!";
NSString *expected = @"Woah, chill out!";
NSString *result = [[self bob] hey:input];
XCTAssertEqualObjects(expected, result, @"");
}
- (void)testCalmlySpeakingAboutUmlauts {
NSString *input = @"ÄMLäTS!";
NSString *expected = @"Whatever.";
NSString *result = [[self bob] hey:input];
XCTAssertEqualObjects(expected, result, @"");
}
- (void)testShoutingWithNoExclamationMark {
NSString *input = @"I HATE YOU";
NSString *expected = @"Woah, chill out!";
NSString *result = [[self bob] hey:input];
XCTAssertEqualObjects(expected, result, @"");
}
- (void)testStatementContainingQuestionsMark {
NSString *input = @"Ending with a ? means a question.";
NSString *expected = @"Whatever.";
NSString *result = [[self bob] hey:input];
XCTAssertEqualObjects(expected, result, @"");
}
- (void)testPrattlingOn {
NSString *input = @"Wait! Hang on. Are you going to be OK?";
NSString *expected = @"Sure.";
NSString *result = [[self bob] hey:input];
XCTAssertEqualObjects(expected, result, @"");
}
- (void)testSilence {
NSString *input = @"";
NSString *expected = @"Fine, be that way.";
NSString *result = [[self bob] hey:input];
XCTAssertEqualObjects(expected, result, @"");
}
- (void)testProlongedSilence {
NSString *input = @" ";
NSString *expected = @"Fine, be that way.";
NSString *result = [[self bob] hey:input];
XCTAssertEqualObjects(expected, result, @"");
}
@end