Skip to content

Commit 0c9d510

Browse files
committed
Reorganize files
1 parent bb45fb1 commit 0c9d510

File tree

3 files changed

+104
-6
lines changed

3 files changed

+104
-6
lines changed

src/TapkuLibrary.xcodeproj/project.pbxproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
3B30B17B129EE10B00466666 /* UIToolbar+TKCategory.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B30B16C129EE0DF00466666 /* UIToolbar+TKCategory.h */; };
2222
3B4346E412DA6A240076579B /* UIButton+TKCategory.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B4346E212DA6A240076579B /* UIButton+TKCategory.h */; };
2323
3B4346E512DA6A240076579B /* UIButton+TKCategory.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B4346E312DA6A240076579B /* UIButton+TKCategory.m */; };
24-
3B45DDFE134C737F00D24C1A /* FoundationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B45DDFB134C737F00D24C1A /* FoundationTests.m */; };
2524
3B6EDDD311547BEB00E454DA /* TapkuLibrary.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BAC9A1B10953E5200F235F1 /* TapkuLibrary.h */; };
2625
3B6EDDD611547BF800E454DA /* TKGlobal.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BAC9A1E10953E5200F235F1 /* TKGlobal.m */; };
2726
3B6EDDDA11547C1100E454DA /* UIView+TKCategory.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BAC9A2210953E5200F235F1 /* UIView+TKCategory.m */; };
@@ -88,6 +87,7 @@
8887
3B859F03134C76C700661088 /* NSDate+TKCategory.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BAC9A2410953E5200F235F1 /* NSDate+TKCategory.m */; };
8988
3B859F04134C76C700661088 /* NSDictionary+TKCategory.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BE54E7B134548CA00B59702 /* NSDictionary+TKCategory.m */; };
9089
3B859F08134C76D500661088 /* NSString+TKCategory.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BF000FD10957EE50062DA49 /* NSString+TKCategory.m */; };
90+
3B89162B134D93D000BD2B31 /* FoundationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B89162A134D93D000BD2B31 /* FoundationTests.m */; };
9191
3B9724BD11C54C5C0027A97F /* TKCalendarMonthView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B9724B911C54C5C0027A97F /* TKCalendarMonthView.h */; };
9292
3B9724BE11C54C5C0027A97F /* TKCalendarMonthView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B9724BA11C54C5C0027A97F /* TKCalendarMonthView.m */; };
9393
3B9D93DA12F74F8F007D839C /* TKAppDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B9D93D812F74F8F007D839C /* TKAppDelegate.h */; };
@@ -141,11 +141,11 @@
141141
3B4346E312DA6A240076579B /* UIButton+TKCategory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIButton+TKCategory.m"; sourceTree = "<group>"; };
142142
3B45DDF1134C736600D24C1A /* LogicTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LogicTests.octest; sourceTree = BUILT_PRODUCTS_DIR; };
143143
3B45DDF2134C736600D24C1A /* LogicTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LogicTests-Info.plist"; sourceTree = "<group>"; };
144-
3B45DDFA134C737F00D24C1A /* FoundationTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FoundationTests.h; sourceTree = "<group>"; };
145-
3B45DDFB134C737F00D24C1A /* FoundationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FoundationTests.m; sourceTree = "<group>"; };
146144
3B859EC5134C74D800661088 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
147145
3B879FC4109BFC07002012FD /* TKCalendarMonthTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TKCalendarMonthTableViewController.h; sourceTree = "<group>"; };
148146
3B879FC5109BFC07002012FD /* TKCalendarMonthTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TKCalendarMonthTableViewController.m; sourceTree = "<group>"; };
147+
3B891629134D93D000BD2B31 /* FoundationTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FoundationTests.h; path = Tests/FoundationTests.h; sourceTree = "<group>"; };
148+
3B89162A134D93D000BD2B31 /* FoundationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FoundationTests.m; path = Tests/FoundationTests.m; sourceTree = "<group>"; };
149149
3B917CE810F34BF400049677 /* TKCoverflowView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TKCoverflowView.h; sourceTree = "<group>"; };
150150
3B917CE910F34BF400049677 /* TKCoverflowView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TKCoverflowView.m; sourceTree = "<group>"; };
151151
3B917CEA10F34BF400049677 /* TKCoverflowCoverView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TKCoverflowCoverView.h; sourceTree = "<group>"; };
@@ -336,8 +336,8 @@
336336
isa = PBXGroup;
337337
children = (
338338
3B45DDF2134C736600D24C1A /* LogicTests-Info.plist */,
339-
3B45DDFA134C737F00D24C1A /* FoundationTests.h */,
340-
3B45DDFB134C737F00D24C1A /* FoundationTests.m */,
339+
3B891629134D93D000BD2B31 /* FoundationTests.h */,
340+
3B89162A134D93D000BD2B31 /* FoundationTests.m */,
341341
);
342342
name = UnitTests;
343343
sourceTree = "<group>";
@@ -768,11 +768,11 @@
768768
isa = PBXSourcesBuildPhase;
769769
buildActionMask = 2147483647;
770770
files = (
771-
3B45DDFE134C737F00D24C1A /* FoundationTests.m in Sources */,
772771
3B859F02134C76C600661088 /* NSArray+TKCategory.m in Sources */,
773772
3B859F03134C76C700661088 /* NSDate+TKCategory.m in Sources */,
774773
3B859F04134C76C700661088 /* NSDictionary+TKCategory.m in Sources */,
775774
3B859F08134C76D500661088 /* NSString+TKCategory.m in Sources */,
775+
3B89162B134D93D000BD2B31 /* FoundationTests.m in Sources */,
776776
);
777777
runOnlyForDeploymentPostprocessing = 0;
778778
};

src/Tests/FoundationTests.h

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//
2+
// LogicTests.h
3+
// TapkuLibrary
4+
//
5+
// Created by Devin Ross on 4/6/11.
6+
// Copyright 2011 __MyCompanyName__. All rights reserved.
7+
//
8+
9+
10+
#import <SenTestingKit/SenTestingKit.h>
11+
#import <Foundation/Foundation.h>
12+
#import <UIKit/UIKit.h>
13+
14+
#import "NSString+TKCategory.h"
15+
#import "NSDate+TKCategory.h"
16+
#import "NSArray+TKCategory.h"
17+
18+
19+
@interface FoundationTests : SenTestCase {
20+
21+
}
22+
23+
24+
- (void) testStringCategory;
25+
- (void) testDateCategory;
26+
27+
@end

src/Tests/FoundationTests.m

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
//
2+
// LogicTests.m
3+
// TapkuLibrary
4+
//
5+
// Created by Devin Ross on 4/6/11.
6+
// Copyright 2011 __MyCompanyName__. All rights reserved.
7+
//
8+
9+
#import "FoundationTests.h"
10+
11+
12+
@implementation FoundationTests
13+
14+
15+
16+
- (void) testStringCategory{
17+
18+
NSString *string;
19+
BOOL valid;
20+
21+
22+
string = @"bob@sanders.com";
23+
valid = [string isEmail];
24+
STAssertTrue(valid, @"Expected %@ to be a valid email", string);
25+
26+
27+
string = @"aosda.bOb@sANDdsadrs.c";
28+
valid = [string isEmail];
29+
STAssertTrue(valid, @"Expected %@ to be a valid email", string);
30+
31+
32+
string = @"ao,sda.bOb@sANDdsadrs.c";
33+
valid = [string isEmail];
34+
STAssertFalse(valid, @"Expected %@ to be a valid email", string);
35+
36+
37+
}
38+
- (void) testDateCategory{
39+
NSDate *date,*other;
40+
BOOL value;
41+
42+
date = [NSDate date];
43+
value = [date isToday];
44+
STAssertTrue(value,@"Expected %@ is today.",date);
45+
46+
date = [NSDate yesterday];
47+
value = [date isToday];
48+
STAssertFalse(value,@"Expected %@ is not today.",date);
49+
50+
51+
other = [NSDate date];
52+
value = [date isSameDay:other];
53+
STAssertFalse(value,@"Expected %@ is not same day as %@.",date,other);
54+
55+
56+
date = [NSDate date];
57+
TKDateInformation info = [date dateInformation];
58+
info.day = 1;
59+
info.hour = info.minute = info.second = 0;
60+
other = [NSDate dateFromDateInformation:info];
61+
value = [other isSameDay:[date monthDate]];
62+
STAssertTrue(value, @"Expected %@ is same day as %@.",other,date);
63+
64+
date = [NSDate date];
65+
other = [NSDate yesterday];
66+
int diff = [date daysBetweenDate:other];
67+
STAssertEquals(diff, 1, @"Expected difference between %@ and %@ is zero.",date,other);
68+
}
69+
70+
71+
@end

0 commit comments

Comments
 (0)