Permalink
Browse files

Added TumblrKit Tests for iOS

  • Loading branch information...
1 parent c714e1b commit a77b21377fa479892fd66905947d2b7670c4bb12 @isutton committed May 31, 2012
View
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="CIDR_MODULE" version="4">
+ <component name="NewModuleRootManager">
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ </component>
+</module>
+
View
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
+</project>
+
@@ -0,0 +1,7 @@
+<component name="InspectionProjectProfileManager">
+ <profile version="1.0" is_locked="false">
+ <option name="myName" value="Project Default" />
+ <option name="myLocal" value="false" />
+ <inspection_tool class="OCUnusedClassInspection" enabled="false" level="WARNING" enabled_by_default="false" />
+ </profile>
+</component>
@@ -0,0 +1,7 @@
+<component name="InspectionProjectProfileManager">
+ <settings>
+ <option name="PROJECT_PROFILE" value="Project Default" />
+ <option name="USE_PROJECT_PROFILE" value="true" />
+ <version value="1.0" />
+ </settings>
+</component>
View
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ProjectResources">
+ <default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
+ </component>
+ <component name="ProjectRootManager" version="2" />
+</project>
+
View
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ProjectModuleManager">
+ <modules>
+ <module fileurl="file://$PROJECT_DIR$/.idea/TumblrKit.iml" filepath="$PROJECT_DIR$/.idea/TumblrKit.iml" />
+ </modules>
+ </component>
+</project>
+
@@ -0,0 +1,5 @@
+<component name="DependencyValidationManager">
+ <state>
+ <option name="SKIP_IMPORT_STATEMENTS" value="false" />
+ </state>
+</component>
View
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="VcsDirectoryMappings">
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
+ </component>
+</project>
+
View
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="XcodeMetaData" PROJECT_FILE="$PROJECT_DIR$/TumblrKit.xcodeproj" />
+</project>
+
View
@@ -200,12 +200,12 @@ typedef enum
NSMutableString *caption;
NSString *source;
TKImage *image;
- NSUInteger width;
- NSUInteger height;
+ NSInteger width;
+ NSInteger height;
}
-@property (assign) NSUInteger width;
-@property (assign) NSUInteger height;
+@property (assign) NSInteger width;
+@property (assign) NSInteger height;
@property (copy) NSString *source;
@property (strong) TKImage *image;
View
@@ -101,17 +101,20 @@ + (id)postWithAttributes:(NSDictionary *)attributeDict
Simplistic dictionary to be used statically. Used to map a Tumblr's post type
to internal TumblrKit class names.
*/
- NSDictionary *TKPostTypeToClassNameDict = [NSDictionary dictionaryWithObjectsAndKeys:
- @"TKPostPhoto", @"photo",
- @"TKPostConversation", @"conversation",
- @"TKPostLink", @"link",
- @"TKPostQuote", @"quote",
- @"TKPostRegular", @"regular",
- @"TKPostVideo", @"video",
- @"TKPostAudio", @"audio",
- nil];
+ static NSDictionary *TKPostTypeToClassNameDict;
+ if (!TKPostTypeToClassNameDict) {
+ TKPostTypeToClassNameDict = [NSDictionary dictionaryWithObjectsAndKeys:
+ @"TKPostPhoto", @"photo",
+ @"TKPostConversation", @"conversation",
+ @"TKPostLink", @"link",
+ @"TKPostQuote", @"quote",
+ @"TKPostRegular", @"regular",
+ @"TKPostVideo", @"video",
+ @"TKPostAudio", @"audio",
+ nil];
+ }
- Class postClass = nil;
+ Class postClass;
NSString *type_ = [attributeDict objectForKey:@"type"];
postClass = NSClassFromString([TKPostTypeToClassNameDict objectForKey:type_]);
@@ -380,8 +383,8 @@ - (id)init
- (id)initWithAttributes:(NSDictionary *)attributeDict
{
if ((self = [super initWithAttributes:attributeDict]) != nil) {
- width = [[attributeDict objectForKey:@"width"] intValue];
- height = [[attributeDict objectForKey:@"height"] intValue];
+ width = [[attributeDict objectForKey:@"width"] integerValue];
+ height = [[attributeDict objectForKey:@"height"] integerValue];
}
return self;
View
@@ -52,7 +52,7 @@
@end
-extern NSString *TKPostsRequestDomainKey;
-extern NSString *TKPostsRequestPostIDKey;
-extern NSString *TKPostsRequestStartAtIndexKey;
-extern NSString *TKPostsRequestNumberOfPostsKey;
+extern NSString const *TKPostsRequestDomainKey;
+extern NSString const *TKPostsRequestPostIDKey;
+extern NSString const *TKPostsRequestStartAtIndexKey;
+extern NSString const *TKPostsRequestNumberOfPostsKey;
View
@@ -137,7 +137,7 @@ - (NSDictionary *)options;
@end
-NSString const * TKPostsRequestDomainKey = @"domain";
-NSString const * TKPostsRequestPostIDKey = @"id";
-NSString const * TKPostsRequestStartAtIndexKey = @"start";
-NSString const * TKPostsRequestNumberOfPostsKey = @"num";
+NSString const *TKPostsRequestDomainKey = @"domain";
+NSString const *TKPostsRequestPostIDKey = @"id";
+NSString const *TKPostsRequestStartAtIndexKey = @"start";
+NSString const *TKPostsRequestNumberOfPostsKey = @"num";
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.qiih.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+</dict>
+</plist>
@@ -0,0 +1,8 @@
+//
+// Prefix header for all source files of the 'TumblrKit Tests for iOS' target in the 'TumblrKit Tests for iOS' project
+//
+
+#ifdef __OBJC__
+ #import <UIKit/UIKit.h>
+ #import <Foundation/Foundation.h>
+#endif
@@ -0,0 +1,13 @@
+//
+// TumblrKit_Tests_for_iOS.h
+// TumblrKit Tests for iOS
+//
+// Created by Igor Sutton on 5/31/12.
+// Copyright (c) 2012 igorsutton.com. All rights reserved.
+//
+
+#import <SenTestingKit/SenTestingKit.h>
+
+@interface TumblrKit_Tests_for_iOS : SenTestCase
+
+@end
@@ -0,0 +1,32 @@
+//
+// TumblrKit_Tests_for_iOS.m
+// TumblrKit Tests for iOS
+//
+// Created by Igor Sutton on 5/31/12.
+// Copyright (c) 2012 igorsutton.com. All rights reserved.
+//
+
+#import "TumblrKit_Tests_for_iOS.h"
+
+@implementation TumblrKit_Tests_for_iOS
+
+- (void)setUp
+{
+ [super setUp];
+
+ // Set-up code here.
+}
+
+- (void)tearDown
+{
+ // Tear-down code here.
+
+ [super tearDown];
+}
+
+- (void)testExample
+{
+ STFail(@"Unit tests are not implemented yet in TumblrKit Tests for iOS");
+}
+
+@end
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
Oops, something went wrong.

0 comments on commit a77b213

Please sign in to comment.