Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

adding cw_isNotEmptyString to NSString and a unit test for it

  • Loading branch information...
commit 7650c2ec8704ac0a1ca076fec981c67ad8ec1ebe 1 parent a2b1f83
@Machx authored
View
7 Source/CWNSStringTests.m
@@ -19,4 +19,11 @@ -(void)testUUIDStrings
STAssertTrue((![string1 isEqualToString:string2]),@"String 1 and String shouldn't be the same");
}
+-(void)testEmptyStringMethod
+{
+ NSString *emptyString1 = @"";
+
+ STAssertTrue(![emptyString1 cw_isNotEmptyString],@"String1 should be empty");
+}
+
@end
View
2  Source/NSStringAdditions.h
@@ -17,4 +17,6 @@
- (NSString *) cw_stringByAddingPercentEscapesUsingEncoding: (NSStringEncoding) encoding legalURLCharactersToBeEscaped: (NSString *) legalCharacters;
- (NSString *) cw_stringByReplacingPercentEscapes;
+- (BOOL) cw_isNotEmptyString;
+
@end
View
8 Source/NSStringAdditions.m
@@ -93,4 +93,12 @@ - (NSString *) cw_stringByReplacingPercentEscapes
return returnString;
}
+/**
+ Quick test for an empty string
+ */
+- (BOOL) cw_isNotEmptyString
+{
+ return ![self isEqualToString:@""];
+}
+
@end

0 comments on commit 7650c2e

Please sign in to comment.
Something went wrong with that request. Please try again.