Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 38 lines (27 sloc) 1.036 kB
652d62b @supermarin Added tests for KWFormatter
supermarin authored
1 //
2 // KWFormatterTest.m
3 // Kiwi
4 //
5 // Created by Marin Usalj on 3/23/13.
6 // Copyright (c) 2013 Allen Ding. All rights reserved.
7 //
8
9 #import "Kiwi.h"
10 #import "KiwiTestConfiguration.h"
11
12 #if KW_TESTS_ENABLED
13
14 @interface KWFormatterTest : SenTestCase
15
16 @end
17
18 @implementation KWFormatterTest
19
20 - (void)testFormatsStringsWithQuotes {
21 NSString *sampleString = @"sample";
22 STAssertEqualObjects(@"\"sample\"", [KWFormatter formatObject:sampleString], @"String should be surrounded with quotes");
23 }
24
25 - (void)testFormatsEnumerableCollectionsInline {
26 NSArray *sampleArray = @[@1, @2, @3];
27 STAssertEqualObjects(@"(1, 2, 3)", [KWFormatter formatObject:sampleArray], @"Array objects should be formatted inline");
28 }
29
30 - (void)testFormatsDictionariesWithKeysAndValuesMultiline {
31 NSDictionary *sampleDict = @{ @"foo" : @"bar", @"baz" : @"bang" };
32 STAssertEqualObjects([sampleDict description], [KWFormatter formatObject:sampleDict], @"Dictionaries should be not treated as NSEnumerable");
33 }
34
35 @end
36
37 #endif // #if KW_TESTS_ENABLED
Something went wrong with that request. Please try again.