forked from ResearchKit/ResearchKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated unit tests for ORKEmailAnswerFormat.
- Loading branch information
Umer Khan
authored and
Umer Khan
committed
Jul 7, 2015
1 parent
4e56c56
commit 12ef17e
Showing
2 changed files
with
14 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,12 +42,21 @@ @implementation ORKAnswerFormatTests | |
|
||
- (void)testValidEmailAnswerFormat { | ||
// Test email regex validation with correct input. | ||
XCTAssert([[ORKEmailAnswerFormat emailAnswerFormat] isAnswerValidWithString:@"[email protected]"]); | ||
XCTAssert([[ORKEmailAnswerFormat emailAnswerFormat] isAnswerValidWithString:@"[email protected]"]); | ||
XCTAssert([[ORKEmailAnswerFormat emailAnswerFormat] isAnswerValidWithString:@"[email protected]"]); | ||
XCTAssert([[ORKEmailAnswerFormat emailAnswerFormat] isAnswerValidWithString:@"[email protected]"]); | ||
XCTAssert([[ORKEmailAnswerFormat emailAnswerFormat] isAnswerValidWithString:@"[email protected]"]); | ||
XCTAssert([[ORKEmailAnswerFormat emailAnswerFormat] isAnswerValidWithString:@"[email protected]"]); | ||
XCTAssert([[ORKEmailAnswerFormat emailAnswerFormat] isAnswerValidWithString:@"[email protected]"]); | ||
} | ||
|
||
- (void)testInvalidEmailAnswerFormat { | ||
// Test email regex validation with incorrect input. | ||
XCTAssertFalse([[ORKEmailAnswerFormat emailAnswerFormat] isAnswerValidWithString:@"emailtest"]); | ||
XCTAssertFalse([[ORKEmailAnswerFormat emailAnswerFormat] isAnswerValidWithString:@"emailtest@"]); | ||
XCTAssertFalse([[ORKEmailAnswerFormat emailAnswerFormat] isAnswerValidWithString:@"emailtest@researchkit"]); | ||
XCTAssertFalse([[ORKEmailAnswerFormat emailAnswerFormat] isAnswerValidWithString:@"[email protected]"]); | ||
XCTAssertFalse([[ORKEmailAnswerFormat emailAnswerFormat] isAnswerValidWithString:@"12345"]); | ||
} | ||
|
||
@end |