├── .gitignore ├── LICENSE ├── Mailcheck-ObjectiveC.podspec ├── Mailcheck ├── Mailcheck.h └── Mailcheck.m ├── MailcheckDemo ├── GHUnitIOS.framework │ ├── GHUnitIOS │ ├── Headers │ ├── Resources │ └── Versions │ │ ├── A │ │ ├── GHUnitIOS │ │ ├── Headers │ │ │ ├── GHAsyncTestCase.h │ │ │ ├── GHImageDiffView.h │ │ │ ├── GHMockNSHTTPURLResponse.h │ │ │ ├── GHMockNSURLConnection.h │ │ │ ├── GHTest+JUnitXML.h │ │ │ ├── GHTest.h │ │ │ ├── GHTestCase.h │ │ │ ├── GHTestGroup+JUnitXML.h │ │ │ ├── GHTestGroup.h │ │ │ ├── GHTestMacros.h │ │ │ ├── GHTestOperation.h │ │ │ ├── GHTestRunner.h │ │ │ ├── GHTestSuite.h │ │ │ ├── GHTestUtils.h │ │ │ ├── GHTestViewModel.h │ │ │ ├── GHTesting.h │ │ │ ├── GHUIImageViewControl.h │ │ │ ├── GHUnit.h │ │ │ ├── GHUnitIOSAppDelegate.h │ │ │ ├── GHUnitIOSTableViewDataSource.h │ │ │ ├── GHUnitIOSTestView.h │ │ │ ├── GHUnitIOSTestViewController.h │ │ │ ├── GHUnitIOSView.h │ │ │ ├── GHUnitIOSViewController.h │ │ │ ├── GHUnitIPhoneAppDelegate.h │ │ │ ├── GHViewTestCase.h │ │ │ ├── NSException+GHTestFailureExceptions.h │ │ │ └── NSValue+GHValueFormatter.h │ │ └── Resources │ │ │ └── Info.plist │ │ └── Current ├── MailcheckDemo.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcuserdata │ │ └── David.xcuserdatad │ │ └── xcschemes │ │ ├── MailcheckDemo.xcscheme │ │ ├── Tests.xcscheme │ │ └── xcschememanagement.plist ├── MailcheckDemo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Default-568h@2x.png │ ├── Default.png │ ├── Default@2x.png │ ├── MailcheckDemo-Info.plist │ ├── MailcheckDemo-Prefix.pch │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m ├── Podfile ├── Podfile.lock └── Tests │ ├── Default-568h@2x.png │ ├── Default.png │ ├── Default@2x.png │ ├── TestMailcheck.m │ ├── Tests-Info.plist │ ├── Tests-Prefix.pch │ ├── en.lproj │ └── InfoPlist.strings │ └── main.m ├── README.md └── Tests └── TestMailcheck.m /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.swp 3 | *~.nib 4 | 5 | build/ 6 | 7 | *.pbxuser 8 | *.perspective 9 | *.perspectivev3 10 | 11 | *.mode1v3 12 | *.mode2v3 13 | 14 | xcuserdata 15 | *.xcworkspace 16 | *.xccheckout 17 | 18 | Pods 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright © 2012 Received Inc, http://kicksend.com 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the “Software”), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /Mailcheck-ObjectiveC.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "Mailcheck-ObjectiveC" 3 | s.version = "0.3" 4 | s.summary = "An Objective-C port of Kicksend's Mailcheck. Suggest corrections for misspelled email addresses." 5 | s.homepage = "https://github.com/Mailcheck/Mailcheck-ObjectiveC" 6 | 7 | s.license = { :type => 'MIT', :file => 'LICENSE' } 8 | 9 | s.author = { "David Kasper" => "dkasper@gmail.com" } 10 | s.source = { :git => "https://github.com/dkasper/Mailcheck-ObjectiveC.git", :tag => "0.3" } 11 | 12 | s.platform = :ios, '6.0' 13 | 14 | s.source_files = 'Mailcheck/*.{h,m}' 15 | 16 | s.requires_arc = true 17 | 18 | s.dependency 'NSString-Email' 19 | end 20 | -------------------------------------------------------------------------------- /Mailcheck/Mailcheck.h: -------------------------------------------------------------------------------- 1 | // 2 | // Mailcheck.h 3 | // Frost 4 | // 5 | // Created by David Kasper on 1/3/13. 6 | // Licensed under the MIT License. 7 | // 8 | 9 | #import 10 | 11 | @interface Mailcheck : NSObject 12 | 13 | +(NSDictionary *)suggest:(NSString *)email; 14 | +(NSDictionary *)suggest:(NSString *)email extraDomains:(NSArray *)domains extraTopLevelDomains:(NSArray *)topLevelDomains; 15 | +(NSDictionary *)suggest:(NSString *)email domains:(NSArray *)domains topLevelDomains:(NSArray *)topLevelDomains; 16 | 17 | // New interface that includes email validity checking 18 | +(NSDictionary *)check:(NSString *)email; 19 | +(NSDictionary *)check:(NSString *)email extraDomains:(NSArray *)domains extraTopLevelDomains:(NSArray *)topLevelDomains; 20 | +(NSDictionary *)check:(NSString *)email domains:(NSArray *)domains topLevelDomains:(NSArray *)topLevelDomains; 21 | 22 | // Configure threshold 23 | +(void)setThreshold:(NSInteger)threshold; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Mailcheck/Mailcheck.m: -------------------------------------------------------------------------------- 1 | // 2 | // Mailcheck.m 3 | // Frost 4 | // 5 | // Created by David Kasper on 1/3/13. 6 | // Licensed under the MIT License. 7 | // 8 | 9 | #import "Mailcheck.h" 10 | #import 11 | 12 | @implementation Mailcheck 13 | 14 | static NSArray *defaultDomains, *defaultTopLevelDomains; 15 | static NSInteger threshold; 16 | 17 | +(void)initialize { 18 | defaultDomains = @[@"yahoo.com", @"google.com", @"hotmail.com", @"gmail.com", @"me.com", @"aol.com", @"mac.com", @"live.com", @"comcast.net", @"googlemail.com", @"msn.com", @"hotmail.co.uk", @"yahoo.co.uk", @"facebook.com", @"verizon.net", @"sbcglobal.net", @"att.net", @"gmx.com", @"mail.com"]; 19 | 20 | defaultTopLevelDomains = @[@"co.uk", @"com", @"net", @"org", @"info", @"edu", @"gov", @"mil"]; 21 | threshold = 3; 22 | } 23 | 24 | +(void)setThreshold:(NSInteger)newThreshold { 25 | threshold = newThreshold; 26 | } 27 | 28 | +(NSDictionary *)check:(NSString *)email { 29 | return [self check:email domains:defaultDomains topLevelDomains:defaultTopLevelDomains]; 30 | } 31 | 32 | +(NSDictionary *)check:(NSString *)email extraDomains:(NSArray *)domains extraTopLevelDomains:(NSArray *)topLevelDomains { 33 | return [self check:email domains:[defaultDomains arrayByAddingObjectsFromArray:domains] topLevelDomains:[defaultTopLevelDomains arrayByAddingObjectsFromArray:topLevelDomains]]; 34 | } 35 | 36 | +(NSDictionary *)check:(NSString *)email domains:(NSArray *)domains topLevelDomains:(NSArray *)topLevelDomains { 37 | NSDictionary *suggestion = [self suggest:email domains:domains topLevelDomains:topLevelDomains]; 38 | if(suggestion) { 39 | return @{@"valid": @([email isEmail]), @"suggestion": suggestion}; 40 | } 41 | return @{@"valid": @([email isEmail])}; 42 | } 43 | 44 | +(NSDictionary *)suggest:(NSString *)email { 45 | return [self suggest:email domains:defaultDomains topLevelDomains:defaultTopLevelDomains]; 46 | } 47 | 48 | +(NSDictionary *)suggest:(NSString *)email extraDomains:(NSArray *)domains extraTopLevelDomains:(NSArray *)topLevelDomains { 49 | return [self suggest:email domains:[defaultDomains arrayByAddingObjectsFromArray:domains] topLevelDomains:[defaultTopLevelDomains arrayByAddingObjectsFromArray:topLevelDomains]]; 50 | } 51 | 52 | +(NSDictionary *)suggest:(NSString *)email domains:(NSArray *)domains topLevelDomains:(NSArray *)topLevelDomains { 53 | email = [email lowercaseString]; 54 | NSDictionary *emailParts = [self splitEmail:email]; 55 | 56 | if(emailParts) { 57 | NSString *closestDomain = [self findClosestDomain:emailParts[@"domain"] domains:domains]; 58 | if(closestDomain && ![closestDomain isEqualToString:emailParts[@"domain"]]) { 59 | return @{@"address": emailParts[@"address"], @"domain": closestDomain, @"full": [emailParts[@"address"] stringByAppendingFormat:@"@%@",closestDomain]}; 60 | } else { 61 | NSString *closestTopLevelDomain = [self findClosestDomain:emailParts[@"topLevelDomain"] domains:topLevelDomains]; 62 | if(emailParts[@"domain"] && closestTopLevelDomain && ![closestTopLevelDomain isEqualToString:emailParts[@"topLevelDomain"]]) { 63 | NSString *domain = emailParts[@"domain"]; 64 | NSRange lastRange = [domain rangeOfString:emailParts[@"topLevelDomain"] options:NSBackwardsSearch]; 65 | closestDomain = [[domain substringWithRange:NSMakeRange(0, MIN(domain.length, lastRange.location))] stringByAppendingString:closestTopLevelDomain]; 66 | return @{@"address": emailParts[@"address"], @"domain": closestDomain, @"full": [emailParts[@"address"] stringByAppendingFormat:@"@%@",closestDomain]}; 67 | } 68 | } 69 | } 70 | 71 | return nil; 72 | } 73 | 74 | +(NSString *)findClosestDomain:(NSString *)domain domains:(NSArray *)domains { 75 | NSInteger dist; 76 | NSInteger minDist = 99; 77 | NSString *closestDomain = nil; 78 | 79 | if (!domain || !domains) { 80 | return nil; 81 | } 82 | 83 | for(NSString *targetDomain in domains) { 84 | if ([domain isEqualToString:targetDomain]) { 85 | return domain; 86 | } 87 | dist = [self sift3Distance:domain :targetDomain]; 88 | if (dist < minDist) { 89 | minDist = dist; 90 | closestDomain = targetDomain; 91 | } 92 | } 93 | 94 | if (minDist <= threshold && closestDomain) { 95 | return closestDomain; 96 | } else { 97 | return nil; 98 | } 99 | } 100 | 101 | +(NSInteger)sift3Distance:(NSString *)s1 :(NSString *)s2 { 102 | // sift3: http://siderite.blogspot.com/2007/04/super-fast-and-accurate-string-distance.html 103 | if (!s1 || [s1 length] == 0) { 104 | if (!s2 || [s2 length] == 0) { 105 | return 0; 106 | } else { 107 | return [s2 length]; 108 | } 109 | } 110 | 111 | if (!s2 || [s2 length] == 0) { 112 | return [s1 length]; 113 | } 114 | 115 | NSInteger c = 0; 116 | NSInteger offset1 = 0; 117 | NSInteger offset2 = 0; 118 | NSInteger lcs = 0; 119 | NSInteger maxOffset = 5; 120 | 121 | while ((c + offset1 < [s1 length]) && (c + offset2 < [s2 length])) { 122 | if ([s1 characterAtIndex:c+offset1] == [s2 characterAtIndex:c + offset2]) { 123 | lcs++; 124 | } else { 125 | offset1 = 0; 126 | offset2 = 0; 127 | for (NSInteger i = 0; i < maxOffset; i++) { 128 | if ((c + i < [s1 length]) && ([s1 characterAtIndex:(c + i)] == [s2 characterAtIndex:c])) { 129 | offset1 = i; 130 | break; 131 | } 132 | if ((c + i < [s2 length]) && ([s2 characterAtIndex:(c + i)] == [s1 characterAtIndex:c])) { 133 | offset2 = i; 134 | break; 135 | } 136 | } 137 | } 138 | c++; 139 | } 140 | return ([s1 length] + [s2 length]) /2 - lcs; 141 | } 142 | 143 | +(NSDictionary *)splitEmail:(NSString *)email { 144 | NSMutableArray *parts = [[email componentsSeparatedByString:@"@"] mutableCopy]; 145 | 146 | if ([parts count] < 2) { 147 | return nil; 148 | } 149 | 150 | for (NSInteger i = 0; i < [parts count]; i++) { 151 | if ([parts[i] isEqualToString:@""]) { 152 | return nil; 153 | } 154 | } 155 | 156 | NSString *domain = [parts lastObject]; 157 | [parts removeLastObject]; 158 | NSArray *domainParts = [domain componentsSeparatedByString:@"."]; 159 | NSString *tld = @""; 160 | 161 | if ([domainParts count] == 0) { 162 | // The address does not have a top-level domain 163 | return nil; 164 | } else if ([domainParts count] == 1) { 165 | // The address has only a top-level domain (valid under RFC) 166 | tld = domainParts[0]; 167 | } else { 168 | // The address has a domain and a top-level domain 169 | for (NSInteger i = 1; i < [domainParts count]; i++) { 170 | tld = [tld stringByAppendingFormat:@"%@.",domainParts[i]]; 171 | } 172 | if ([domainParts count] >= 2) { 173 | tld = [tld substringWithRange:NSMakeRange(0, [tld length] - 1)]; 174 | } 175 | } 176 | 177 | return @{ 178 | @"topLevelDomain": tld, 179 | @"domain": domain, 180 | @"address": [parts componentsJoinedByString:@"@"] 181 | }; 182 | } 183 | 184 | @end 185 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/GHUnitIOS: -------------------------------------------------------------------------------- 1 | Versions/Current/GHUnitIOS -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/GHUnitIOS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mailcheck/mailcheck-objectivec/48e0fbd049f2c208efada90cd824d1344d4e6d49/MailcheckDemo/GHUnitIOS.framework/Versions/A/GHUnitIOS -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Headers/GHAsyncTestCase.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHAsyncTestCase.h 3 | // GHUnit 4 | // 5 | // Created by Gabriel Handford on 4/8/09. 6 | // Copyright 2009. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | #import "GHTestCase.h" 31 | 32 | /*! 33 | Common wait statuses to use with waitForStatus:timeout:. 34 | */ 35 | enum { 36 | kGHUnitWaitStatusUnknown = 0, // Unknown wait status 37 | kGHUnitWaitStatusSuccess, // Wait status success 38 | kGHUnitWaitStatusFailure, // Wait status failure 39 | kGHUnitWaitStatusCancelled // Wait status cancelled 40 | }; 41 | 42 | /*! 43 | Asynchronous test case with wait and notify. 44 | 45 | If notify occurs before wait has started (if it was a synchronous call), this test 46 | case will still work. 47 | 48 | Be sure to call prepare before the asynchronous method (otherwise an exception will raise). 49 | 50 | @interface MyAsyncTest : GHAsyncTestCase { } 51 | @end 52 | 53 | @implementation MyAsyncTest 54 | 55 | - (void)testSuccess { 56 | // Prepare for asynchronous call 57 | [self prepare]; 58 | 59 | // Do asynchronous task here 60 | [self performSelector:@selector(_succeed) withObject:nil afterDelay:0.1]; 61 | 62 | // Wait for notify 63 | [self waitForStatus:kGHUnitWaitStatusSuccess timeout:1.0]; 64 | } 65 | 66 | - (void)_succeed { 67 | // Notify the wait. Notice the forSelector points to the test above. 68 | // This is so that stray notifies don't error or falsely succeed other tests. 69 | // To ignore the check, forSelector can be NULL. 70 | [self notify:kGHUnitWaitStatusSuccess forSelector:@selector(testSuccess)]; 71 | } 72 | 73 | @end 74 | 75 | */ 76 | @interface GHAsyncTestCase : GHTestCase { 77 | 78 | NSInteger waitForStatus_; 79 | NSInteger notifiedStatus_; 80 | 81 | BOOL prepared_; // Whether prepared was called before waitForStatus:timeout: 82 | NSRecursiveLock *lock_; // Lock to synchronize on 83 | SEL waitSelector_; // The selector we are waiting on 84 | 85 | NSArray *_runLoopModes; 86 | } 87 | 88 | /*! 89 | Run loop modes to run while waiting; 90 | Defaults to NSDefaultRunLoopMode, NSRunLoopCommonModes, NSConnectionReplyMode 91 | */ 92 | @property (strong, nonatomic) NSArray *runLoopModes; 93 | 94 | /*! 95 | Prepare before calling the asynchronous method. 96 | */ 97 | - (void)prepare; 98 | 99 | /*! 100 | Prepare and specify the selector we will use in notify. 101 | 102 | @param selector Selector 103 | */ 104 | - (void)prepare:(SEL)selector; 105 | 106 | /*! 107 | Wait for notification of status or timeout. 108 | 109 | Be sure to prepare before calling your asynchronous method. 110 | For example, 111 | 112 | - (void)testFoo { 113 | [self prepare]; 114 | 115 | // Do asynchronous task here 116 | 117 | [self waitForStatus:kGHUnitWaitStatusSuccess timeout:1.0]; 118 | } 119 | 120 | @param status kGHUnitWaitStatusSuccess, kGHUnitWaitStatusFailure or custom status 121 | @param timeout Timeout in seconds 122 | */ 123 | - (void)waitForStatus:(NSInteger)status timeout:(NSTimeInterval)timeout; 124 | 125 | /*! 126 | @param status kGHUnitWaitStatusSuccess, kGHUnitWaitStatusFailure or custom status 127 | @param timeout Timeout in seconds 128 | @deprecated Use waitForTimeout: 129 | */ 130 | - (void)waitFor:(NSInteger)status timeout:(NSTimeInterval)timeout; 131 | 132 | /*! 133 | Wait for timeout to occur. 134 | Fails if we did _NOT_ timeout. 135 | 136 | @param timeout Timeout 137 | */ 138 | - (void)waitForTimeout:(NSTimeInterval)timeout; 139 | 140 | /*! 141 | Notify waiting of status for test selector. 142 | 143 | @param status Status, for example, kGHUnitWaitStatusSuccess 144 | @param selector If not NULL, then will verify this selector is where we are waiting. This prevents stray asynchronous callbacks to fail a later test. 145 | */ 146 | - (void)notify:(NSInteger)status forSelector:(SEL)selector; 147 | 148 | /*! 149 | Notify waiting of status for any selector. 150 | 151 | @param status Status, for example, kGHUnitWaitStatusSuccess 152 | */ 153 | - (void)notify:(NSInteger)status; 154 | 155 | /*! 156 | Run the run loops for the specified interval. 157 | 158 | @param interval Interval 159 | @author Adapted from Robert Palmer, pauseForTimeout 160 | */ 161 | - (void)runForInterval:(NSTimeInterval)interval; 162 | 163 | @end 164 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Headers/GHImageDiffView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHImageDiffView.h 3 | // GHUnitIOS 4 | // 5 | // Created by John Boiles on 10/27/11. 6 | // Copyright (c) 2011. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | #import 31 | 32 | @interface GHImageDiffView : UIView { 33 | UIScrollView *scrollView_; 34 | UISegmentedControl *segmentedControl_; 35 | 36 | UIImageView *savedImageView_; 37 | UIImageView *renderedImageView_; 38 | UIImageView *diffImageView_; 39 | } 40 | 41 | - (void)setSavedImage:(UIImage *)savedImage renderedImage:(UIImage *)renderedImage diffImage:(UIImage *)diffImage; 42 | 43 | - (void)showSavedImage; 44 | 45 | - (void)showRenderedImage; 46 | 47 | - (void)showDiffImage; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Headers/GHMockNSHTTPURLResponse.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHMockNSHTTPURLResponse.h 3 | // GHUnit 4 | // 5 | // Created by Gabriel Handford on 4/9/09. 6 | // Copyright 2009. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | #import 31 | 32 | /* 33 | NSHTTPURLResponse subclass for use with mocking. 34 | Allows us to manually set the status code and headers in the response. 35 | */ 36 | @interface GHMockNSHTTPURLResponse : NSHTTPURLResponse { 37 | NSInteger statusCode_; 38 | NSDictionary *headers_; 39 | } 40 | 41 | - (id)initWithStatusCode:(NSInteger)statusCode headers:(NSDictionary *)headers; 42 | 43 | - (void)setStatusCode:(NSInteger)code; 44 | - (void)setHeaders:(NSDictionary *)headers; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Headers/GHMockNSURLConnection.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHMockNSURLConnection.h 3 | // GHUnit 4 | // 5 | // Created by Gabriel Handford on 4/9/09. 6 | // Copyright 2009. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | #import 31 | 32 | extern NSString *const GHMockNSURLConnectionException; 33 | 34 | /*! 35 | NSURLConnection for mocking. 36 | 37 | Use with GHAsyncTestCase to mock out connections. 38 | 39 | @interface GHNSURLConnectionMockTest : GHAsyncTestCase {} 40 | @end 41 | 42 | @implementation GHNSURLConnectionMockTest 43 | 44 | - (void)testMock { 45 | [self prepare]; 46 | GHMockNSURLConnection *connection = [[GHMockNSURLConnection alloc] initWithRequest:nil delegate:self]; 47 | [connection receiveHTTPResponseWithStatusCode:204 headers:testHeaders_ afterDelay:0.1]; 48 | [connection receiveData:testData_ afterDelay:0.2]; 49 | [connection finishAfterDelay:0.3]; 50 | [self waitForStatus:kGHUnitWaitStatusSuccess timeout:1.0]; 51 | } 52 | 53 | - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { 54 | GHAssertEquals([(NSHTTPURLResponse *)response statusCode], 204, nil); 55 | GHAssertEqualObjects([(NSHTTPURLResponse *)response allHeaderFields], testHeaders_, nil); 56 | } 57 | 58 | - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { 59 | GHAssertEqualObjects(data, testData_, nil); 60 | } 61 | 62 | - (void)connectionDidFinishLoading:(NSURLConnection *)connection { 63 | [self notify:kGHUnitWaitStatusSuccess forSelector:@selector(testMock)]; 64 | } 65 | @end 66 | 67 | */ 68 | @interface GHMockNSURLConnection : NSObject { 69 | NSURLRequest *request_; 70 | id delegate_; // weak 71 | 72 | BOOL cancelled_; 73 | BOOL started_; 74 | } 75 | 76 | @property (readonly, nonatomic, getter=isStarted) BOOL started; 77 | @property (readonly, nonatomic, getter=isCancelled) BOOL cancelled; 78 | 79 | // Mocked version of NSURLConnection#initWithRequest:delegate: 80 | - (id)initWithRequest:(NSURLRequest *)request delegate:(id)delegate; 81 | 82 | // Mocked version of NSURLConnection#initWithRequest:delegate:startImmediately: 83 | - (id)initWithRequest:(NSURLRequest *)request delegate:(id)delegate startImmediately:(BOOL)startImmediately; 84 | 85 | // Mocked version of NSURLConnection#scheduleInRunLoop:forMode: (NOOP) 86 | - (void)scheduleInRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode; 87 | 88 | // Mocked version of NSURLConnection#start (NOOP) 89 | - (void)start; 90 | 91 | /*! 92 | Send generic response to delegate after delay. 93 | (For asynchronous requests) 94 | @param response Response 95 | @param afterDelay Delay in seconds (if < 0, there is no delay) 96 | */ 97 | - (void)receiveResponse:(NSURLResponse *)response afterDelay:(NSTimeInterval)afterDelay; 98 | 99 | /*! 100 | Send HTTP response to delegate with status code, headers, after delay. 101 | This is only the HTTP response (and not data or finished). 102 | (For asynchronous requests) 103 | @param statusCode HTTP status code 104 | @param headers Headers 105 | @param afterDelay Delay in seconds (if < 0, there is no delay) 106 | */ 107 | - (void)receiveHTTPResponseWithStatusCode:(int)statusCode headers:(NSDictionary *)headers afterDelay:(NSTimeInterval)afterDelay; 108 | 109 | /*! 110 | Send data to connection delegate after delay. 111 | @param data Data to send 112 | @param afterDelay Delay in seconds 113 | */ 114 | - (void)receiveData:(NSData *)data afterDelay:(NSTimeInterval)afterDelay; 115 | 116 | /*! 117 | Send data to connection delegate. 118 | @param data Data to send 119 | @param statusCode HTTP status code 120 | @param MIMEType Mime type 121 | @param afterDelay Delay 122 | */ 123 | - (void)receiveData:(NSData *)data statusCode:(NSInteger)statusCode MIMEType:(NSString *)MIMEType afterDelay:(NSTimeInterval)afterDelay; 124 | 125 | /*! 126 | Send data (from file in bundle resource) to connection delegate after delay. 127 | (For asynchronous requests) 128 | @param path Path to file 129 | @param afterDelay Delay in seconds 130 | */ 131 | - (void)receiveDataFromPath:(NSString *)path afterDelay:(NSTimeInterval)afterDelay; 132 | 133 | /*! 134 | Calls connectionDidFinish: delegate after delay. 135 | (For asynchronous requests) 136 | @param delay Delay in seconds (if < 0, there is no delay) 137 | */ 138 | - (void)finishAfterDelay:(NSTimeInterval)delay; 139 | 140 | /*! 141 | Sends mock response, sends data, and then calls finish. 142 | (For asynchronous requests) 143 | @param path Path to load data from. File should be available in Test target (bundle) 144 | @param statusCode Status code for response 145 | @param MIMEType Content type for response header 146 | @param afterDelay Delay before responding (if < 0, there is no delay) 147 | */ 148 | - (void)receiveFromPath:(NSString *)path statusCode:(NSInteger)statusCode MIMEType:(NSString *)MIMEType afterDelay:(NSTimeInterval)afterDelay; 149 | 150 | /*! 151 | Sends mock response, sends data, and then calls finish. 152 | (For asynchronous requests) 153 | @param data Data to load. File should be available in Test target (bundle) 154 | @param statusCode Status code for response 155 | @param MIMEType Content type for response header 156 | @param afterDelay Delay before responding (if < 0, there is no delay) 157 | */ 158 | - (void)receiveData:(NSData *)data statusCode:(NSInteger)statusCode MIMEType:(NSString *)MIMEType afterDelay:(NSTimeInterval)afterDelay; 159 | 160 | /*! 161 | Calls connection:didFailWithError: on delegate after specified delay. 162 | @param error The error to pass to the delegate. 163 | @param afterDelay Delay before responding (if < 0, there is no delay) 164 | */ 165 | - (void)failWithError:(NSError *)error afterDelay:(NSTimeInterval)afterDelay; 166 | 167 | @end 168 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Headers/GHTest+JUnitXML.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHTest+JUnitXML.h 3 | // GHUnit 4 | // 5 | // Created by Gabriel Handford on 6/4/10. 6 | // Copyright 2010. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | //! @cond DEV 31 | 32 | #import "GHTest.h" 33 | 34 | @interface GHTest(JUnitXML) 35 | 36 | /*! 37 | Return test results in JUnit XML format for external parsing use 38 | (such as a Continuous Integration system like Jenkins). 39 | */ 40 | - (NSString *)JUnitXML; 41 | 42 | @end 43 | 44 | //! @endcond 45 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Headers/GHTest.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHTest.h 3 | // GHUnit 4 | // 5 | // Created by Gabriel Handford on 1/18/09. 6 | // Copyright 2009. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | #import 31 | 32 | 33 | /*! 34 | Test status. 35 | */ 36 | typedef enum { 37 | GHTestStatusNone = 0, 38 | GHTestStatusRunning, //! Test is running 39 | GHTestStatusCancelling, //! Test is being cancelled 40 | GHTestStatusCancelled, //! Test was cancelled 41 | GHTestStatusSucceeded, //! Test finished and succeeded 42 | GHTestStatusErrored, //! Test finished and errored 43 | } GHTestStatus; 44 | 45 | enum { 46 | GHTestOptionReraiseExceptions = 1 << 0, // Allows exceptions to be raised (so you can trigger the debugger) 47 | GHTestOptionForceSetUpTearDownClass = 1 << 1, // Runs setUpClass/tearDownClass for this (each) test; Used when re-running a single test in a group 48 | }; 49 | typedef NSInteger GHTestOptions; 50 | 51 | /*! 52 | Generate string from GHTestStatus 53 | @param status 54 | */ 55 | extern NSString *NSStringFromGHTestStatus(GHTestStatus status); 56 | 57 | /*! 58 | Check if test is running (or trying to cancel). 59 | */ 60 | extern BOOL GHTestStatusIsRunning(GHTestStatus status); 61 | 62 | /*! 63 | Check if test has succeeded, errored or cancelled. 64 | */ 65 | extern BOOL GHTestStatusEnded(GHTestStatus status); 66 | 67 | /*! 68 | Test stats. 69 | */ 70 | typedef struct { 71 | NSInteger succeedCount; // Number of succeeded tests 72 | NSInteger failureCount; // Number of failed tests 73 | NSInteger cancelCount; // Number of aborted tests 74 | NSInteger testCount; // Total number of tests 75 | } GHTestStats; 76 | 77 | /*! 78 | Create GHTestStats. 79 | */ 80 | extern GHTestStats GHTestStatsMake(NSInteger succeedCount, NSInteger failureCount, NSInteger cancelCount, NSInteger testCount); 81 | 82 | extern const GHTestStats GHTestStatsEmpty; 83 | 84 | /*! 85 | Description from test stats. 86 | */ 87 | extern NSString *NSStringFromGHTestStats(GHTestStats stats); 88 | 89 | @protocol GHTestDelegate; 90 | 91 | /*! 92 | The base interface for a runnable test. 93 | 94 | A runnable with a unique identifier, display name, stats, timer, delegate, log and error handling. 95 | */ 96 | @protocol GHTest 97 | 98 | /*! 99 | Unique identifier for test. 100 | */ 101 | @property (readonly, nonatomic) NSString *identifier; 102 | 103 | /*! 104 | Name (readable) for test. 105 | */ 106 | @property (readonly, nonatomic) NSString *name; 107 | 108 | /*! 109 | How long the test took to run. Defaults to -1, if not run. 110 | */ 111 | @property (assign, nonatomic) NSTimeInterval interval; 112 | 113 | /*! 114 | Test status. 115 | */ 116 | @property (assign, nonatomic) GHTestStatus status; 117 | 118 | /*! 119 | Test stats. 120 | */ 121 | @property (readonly, nonatomic) GHTestStats stats; 122 | 123 | /*! 124 | Exception that occurred. 125 | */ 126 | @property (retain, nonatomic) NSException *exception; 127 | 128 | /*! 129 | Whether test is disabled. 130 | */ 131 | @property (assign, nonatomic, getter=isDisabled) BOOL disabled; 132 | 133 | /*! 134 | Whether test is hidden. 135 | */ 136 | @property (assign, nonatomic, getter=isHidden) BOOL hidden; 137 | 138 | /*! 139 | Delegate for test. 140 | */ 141 | @property (assign, nonatomic) id delegate; // weak 142 | 143 | /*! 144 | Run the test. 145 | @param options Options 146 | */ 147 | - (void)run:(GHTestOptions)options; 148 | 149 | /*! 150 | @result Messages logged during this test run 151 | */ 152 | - (NSArray *)log; 153 | 154 | /*! 155 | Reset the test. 156 | */ 157 | - (void)reset; 158 | 159 | /*! 160 | Cancel the test. 161 | */ 162 | - (void)cancel; 163 | 164 | /*! 165 | @result The number of disabled tests 166 | */ 167 | - (NSInteger)disabledCount; 168 | 169 | @end 170 | 171 | /*! 172 | Test delegate for notification when a test starts and ends. 173 | */ 174 | @protocol GHTestDelegate 175 | 176 | /*! 177 | Test started. 178 | @param test Test 179 | @param source If tests are nested, than source corresponds to the originator of the delegate call 180 | */ 181 | - (void)testDidStart:(id)test source:(id)source; 182 | 183 | /*! 184 | Test updated. 185 | @param test Test 186 | @param source If tests are nested, than source corresponds to the originator of the delegate call 187 | */ 188 | - (void)testDidUpdate:(id)test source:(id)source; 189 | 190 | /*! 191 | Test ended. 192 | @param test Test 193 | @param source If tests are nested, than source corresponds to the originator of the delegate call 194 | */ 195 | - (void)testDidEnd:(id)test source:(id)source; 196 | 197 | /*! 198 | Test logged a message. 199 | @param test Test 200 | @param didLog Message 201 | @param source If tests are nested, than source corresponds to the originator of the delegate call 202 | */ 203 | - (void)test:(id)test didLog:(NSString *)didLog source:(id)source; 204 | 205 | @end 206 | 207 | /*! 208 | Delegate which is notified of log messages from inside a test case. 209 | */ 210 | @protocol GHTestCaseLogWriter 211 | 212 | /*! 213 | Log message. 214 | @param message Message 215 | @param testCase Test case 216 | */ 217 | - (void)log:(NSString *)message testCase:(id)testCase; 218 | 219 | @end 220 | 221 | /*! 222 | Default test implementation with a target/selector pair. 223 | 224 | - Tests a target and selector 225 | - Notifies a test delegate 226 | - Keeps track of status, running time and failures 227 | - Stores any test specific logging 228 | 229 | */ 230 | @interface GHTest : NSObject { 231 | 232 | id target_; 233 | SEL selector_; 234 | 235 | NSString *identifier_; 236 | NSString *name_; 237 | GHTestStatus status_; 238 | NSTimeInterval interval_; 239 | BOOL disabled_; 240 | BOOL hidden_; 241 | NSException *exception_; // If failed 242 | 243 | NSMutableArray *log_; 244 | 245 | } 246 | 247 | @property (readonly, strong, nonatomic) id target; 248 | @property (readonly, nonatomic) SEL selector; 249 | @property (readonly, strong, nonatomic) NSArray *log; 250 | 251 | /*! 252 | Create test with identifier, name. 253 | @param identifier Unique identifier 254 | @param name Name 255 | */ 256 | - (id)initWithIdentifier:(NSString *)identifier name:(NSString *)name; 257 | 258 | /*! 259 | Create test with target/selector. 260 | @param target Target (usually a test case) 261 | @param selector Selector (usually a test method) 262 | */ 263 | - (id)initWithTarget:(id)target selector:(SEL)selector; 264 | 265 | /*! 266 | Create autoreleased test with target/selector. 267 | @param target Target (usually a test case) 268 | @param selector Selector (usually a test method) 269 | */ 270 | + (id)testWithTarget:(id)target selector:(SEL)selector; 271 | 272 | @end 273 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Headers/GHTestCase.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHTestCase.h 3 | // GHUnit 4 | // 5 | // Created by Gabriel Handford on 1/21/09. 6 | // Copyright 2009. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | // 31 | // Portions of this file fall under the following license, marked with: 32 | // GTM_BEGIN : GTM_END 33 | // 34 | // Copyright 2008 Google Inc. 35 | // 36 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not 37 | // use this file except in compliance with the License. You may obtain a copy 38 | // of the License at 39 | // 40 | // http://www.apache.org/licenses/LICENSE-2.0 41 | // 42 | // Unless required by applicable law or agreed to in writing, software 43 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 44 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 45 | // License for the specific language governing permissions and limitations under 46 | // the License. 47 | // 48 | 49 | #import "GHTestMacros.h" 50 | #import "GHTest.h" 51 | 52 | /*! 53 | Log to your test case logger. For example, 54 | 55 | GHTestLog(@"Some debug info, %@", obj); 56 | 57 | */ 58 | #define GHTestLog(...) [self log:[NSString stringWithFormat:__VA_ARGS__, nil]] 59 | 60 | /*! 61 | The base class for a test case. 62 | 63 | @interface MyTest : GHTestCase {} 64 | @end 65 | 66 | @implementation MyTest 67 | 68 | // Run before each test method 69 | - (void)setUp { } 70 | 71 | // Run after each test method 72 | - (void)tearDown { } 73 | 74 | // Run before the tests are run for this class 75 | - (void)setUpClass { } 76 | 77 | // Run before the tests are run for this class 78 | - (void)tearDownClass { } 79 | 80 | // Tests are prefixed by 'test' and contain no arguments and no return value 81 | - (void)testA { 82 | GHTestLog(@"Log with a test with the GHTestLog(...) for test specific logging."); 83 | } 84 | 85 | // Another test; Tests are run in lexical order 86 | - (void)testB { } 87 | 88 | // Override any exceptions; By default exceptions are raised, causing a test failure 89 | - (void)failWithException:(NSException *)exception { } 90 | 91 | @end 92 | 93 | */ 94 | @interface GHTestCase : NSObject { 95 | id __unsafe_unretained logWriter_; // weak 96 | 97 | SEL currentSelector_; 98 | } 99 | 100 | //! The current test selector 101 | @property (assign, nonatomic) SEL currentSelector; 102 | @property (unsafe_unretained, nonatomic) id logWriter; 103 | 104 | // GTM_BEGIN 105 | //! Run before each test method 106 | - (void)setUp; 107 | 108 | //! Run after each test method 109 | - (void)tearDown; 110 | 111 | /*! 112 | By default exceptions are raised, causing a test failure 113 | 114 | @param exception Exception that was raised by test 115 | */ 116 | - (void)failWithException:(NSException*)exception; 117 | // GTM_END 118 | 119 | /*! 120 | Run before the tests (once per test case). 121 | */ 122 | - (void)setUpClass; 123 | 124 | /*! 125 | Run after the tests (once per test case). 126 | */ 127 | - (void)tearDownClass; 128 | 129 | /*! 130 | Whether to run the tests on a separate thread. Override this method in your 131 | test case to override the default. 132 | Default is NO, tests are run on a separate thread by default. 133 | 134 | @result If YES, the test will run on the main thread 135 | */ 136 | - (BOOL)shouldRunOnMainThread; 137 | 138 | /*! 139 | Any special handling of exceptions after they are thrown; By default logs stack trace to standard out. 140 | @param exception Exception 141 | */ 142 | - (void)handleException:(NSException *)exception; 143 | 144 | /*! 145 | Log a message, which notifies the log delegate. 146 | This is not meant to be used directly, see GHTestLog(...) macro. 147 | 148 | @param message Message to log 149 | */ 150 | - (void)log:(NSString *)message; 151 | 152 | /*! 153 | Whether the test class should be run as a part of command line tests. 154 | By default this is NO. Subclasses can override this method to disable 155 | test classes that are problematic at the command line. 156 | 157 | @result YES if this test class is disabled for command line tests 158 | */ 159 | - (BOOL)isCLIDisabled; 160 | 161 | @end 162 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Headers/GHTestGroup+JUnitXML.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHTestGroup+JUnitXML.h 3 | // GHUnit 4 | // 5 | // Created by Gabriel Handford on 6/4/10. 6 | // Copyright 2010. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | //! @cond DEV 31 | 32 | #import "GHTestGroup.h" 33 | 34 | @interface GHTestGroup(JUnitXML) 35 | 36 | - (NSString *)JUnitXML; 37 | 38 | - (BOOL)writeJUnitXMLAtPath:(NSString *)documentsPath error:(NSError **)error; 39 | 40 | @end 41 | 42 | //! @endcond 43 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Headers/GHTestGroup.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHTestGroup.h 3 | // 4 | // Created by Gabriel Handford on 1/16/09. 5 | // Copyright 2009. All rights reserved. 6 | // 7 | // Permission is hereby granted, free of charge, to any person 8 | // obtaining a copy of this software and associated documentation 9 | // files (the "Software"), to deal in the Software without 10 | // restriction, including without limitation the rights to use, 11 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the 13 | // Software is furnished to do so, subject to the following 14 | // conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be 17 | // included in all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | // OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | //! @cond DEV 30 | 31 | #import "GHTest.h" 32 | #import "GHTestCase.h" 33 | 34 | /*! 35 | Interface for a group of tests. 36 | 37 | This group conforms to the GHTest protocol as well (see Composite pattern). 38 | */ 39 | @protocol GHTestGroup 40 | 41 | /*! 42 | Name. 43 | */ 44 | - (NSString *)name; 45 | 46 | /*! 47 | Parent for test group. 48 | */ 49 | - (id)parent; 50 | 51 | /*! 52 | Children for test group. 53 | */ 54 | - (NSArray *)children; 55 | 56 | @end 57 | 58 | /*! 59 | A collection of tests (or test groups). 60 | 61 | A test group is a collection of `id`, that may represent a set of test case methods. 62 | 63 | For example, if you had the following GHTestCase. 64 | 65 | @interface FooTest : GHTestCase {} 66 | - (void)testFoo; 67 | - (void)testBar; 68 | @end 69 | 70 | The GHTestGroup would consist of and array of GHTest: FooTest#testFoo, FooTest#testBar, 71 | each test being a target and selector pair. 72 | 73 | A test group may also consist of a group of groups (since GHTestGroup conforms to GHTest), 74 | and this might represent a GHTestSuite. 75 | */ 76 | @interface GHTestGroup : NSObject { 77 | 78 | id __unsafe_unretained parent_; // weak 79 | 80 | NSMutableArray */*of id*/children_; 81 | 82 | NSString *name_; // The name of the test group (usually the class name of the test case 83 | NSTimeInterval interval_; // Total time of child tests 84 | GHTestStatus status_; // Current status of the group (current status of running or completed child tests) 85 | GHTestStats stats_; // Current stats for the group (aggregate of child test stats) 86 | 87 | BOOL didSetUpClass_; 88 | 89 | GHTestOptions options_; 90 | 91 | // Set if test is created from initWithTestCase:delegate: 92 | // Allows use to perform setUpClass and tearDownClass (once per test case run) 93 | id testCase_; 94 | 95 | NSException *exception_; // If exception happens in group setUpClass/tearDownClass 96 | } 97 | 98 | @property (readonly, strong, nonatomic) NSArray */*of id*/children; 99 | @property (unsafe_unretained, nonatomic) id parent; 100 | @property (readonly, strong, nonatomic) id testCase; 101 | @property (assign, nonatomic) GHTestOptions options; 102 | 103 | /*! 104 | Create an empty test group. 105 | @param name The name of the test group 106 | @param delegate Delegate, notifies of test start and end 107 | @result New test group 108 | */ 109 | - (id)initWithName:(NSString *)name delegate:(id)delegate; 110 | 111 | /*! 112 | Create test group from a test case. 113 | @param testCase Test case, could be a subclass of SenTestCase or GHTestCase 114 | @param delegate Delegate, notifies of test start and end 115 | @result New test group 116 | */ 117 | - (id)initWithTestCase:(id)testCase delegate:(id)delegate; 118 | 119 | /*! 120 | Create test group from a single test. 121 | @param testCase Test case, could be a subclass of SenTestCase or GHTestCase 122 | @param selector Test to run 123 | @param delegate Delegate, notifies of test start and end 124 | */ 125 | - (id)initWithTestCase:(id)testCase selector:(SEL)selector delegate:(id)delegate; 126 | 127 | /*! 128 | Create test group from a test case. 129 | @param testCase Test case, could be a subclass of SenTestCase or GHTestCase 130 | @param delegate Delegate, notifies of test start and end 131 | @result New test group 132 | */ 133 | + (GHTestGroup *)testGroupFromTestCase:(id)testCase delegate:(id)delegate; 134 | 135 | /*! 136 | Add a test case (or test group) to this test group. 137 | @param testCase Test case, could be a subclass of SenTestCase or GHTestCase 138 | */ 139 | - (void)addTestCase:(id)testCase; 140 | 141 | /*! 142 | Add a test group to this test group. 143 | @param testGroup Test group to add 144 | */ 145 | - (void)addTestGroup:(GHTestGroup *)testGroup; 146 | 147 | /*! 148 | Add tests to this group. 149 | @param tests Tests to add 150 | */ 151 | - (void)addTests:(NSArray */*of id*/)tests; 152 | 153 | /*! 154 | Add test to this group. 155 | @param test Test to add 156 | */ 157 | - (void)addTest:(id)test; 158 | 159 | /*! 160 | Whether the test group should run on the main thread. 161 | Call passes to test case instance if enabled. 162 | */ 163 | - (BOOL)shouldRunOnMainThread; 164 | 165 | /*! 166 | @result YES if we have any enabled chilren, NO if all children have been disabled. 167 | */ 168 | - (BOOL)hasEnabledChildren; 169 | 170 | /*! 171 | Get list of failed tests. 172 | @result Failed tests 173 | */ 174 | - (NSArray */*of id*/)failedTests; 175 | 176 | /*! 177 | Run in operation queue. 178 | Tests from the group are added and will block until they have completed. 179 | @param operationQueue If nil, then runs as is 180 | @param options Options 181 | */ 182 | - (void)runInOperationQueue:(NSOperationQueue *)operationQueue options:(GHTestOptions)options; 183 | 184 | @end 185 | 186 | //! @endcond 187 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Headers/GHTestOperation.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHTestOperation.h 3 | // GHUnit 4 | // 5 | // Created by Gabriel Handford on 6/4/10. 6 | // Copyright 2010. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | #import "GHTest.h" 31 | 32 | /*! 33 | Test for running in the context of an NSOperationQueue. 34 | */ 35 | @interface GHTestOperation : NSOperation { 36 | id test_; 37 | GHTestOptions options_; 38 | } 39 | 40 | /*! 41 | Create operation that wraps a GHTest instance. 42 | @param test Test 43 | @param options Options 44 | */ 45 | - (id)initWithTest:(id)test options:(GHTestOptions)options; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Headers/GHTestRunner.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHTestRunner.h 3 | // 4 | // Created by Gabriel Handford on 1/16/09. 5 | // Copyright 2008 Gabriel Handford 6 | // 7 | // Permission is hereby granted, free of charge, to any person 8 | // obtaining a copy of this software and associated documentation 9 | // files (the "Software"), to deal in the Software without 10 | // restriction, including without limitation the rights to use, 11 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the 13 | // Software is furnished to do so, subject to the following 14 | // conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be 17 | // included in all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | // OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | //! @cond DEV 30 | 31 | // 32 | // Portions of this file fall under the following license, marked with: 33 | // GTM_BEGIN : GTM_END 34 | // 35 | // Copyright 2008 Google Inc. 36 | // 37 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not 38 | // use this file except in compliance with the License. You may obtain a copy 39 | // of the License at 40 | // 41 | // http://www.apache.org/licenses/LICENSE-2.0 42 | // 43 | // Unless required by applicable law or agreed to in writing, software 44 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 45 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 46 | // License for the specific language governing permissions and limitations under 47 | // the License. 48 | // 49 | 50 | #import "GHTestGroup.h" 51 | #import "GHTestSuite.h" 52 | 53 | @class GHTestRunner; 54 | 55 | /*! 56 | Notifies about the test run. 57 | Delegates can be guaranteed to be notified on the main thread. 58 | */ 59 | @protocol GHTestRunnerDelegate 60 | @optional 61 | 62 | /*! 63 | Test run started. 64 | @param runner Runner 65 | */ 66 | - (void)testRunnerDidStart:(GHTestRunner *)runner; 67 | 68 | /*! 69 | Test run did start test. 70 | @param runner Runner 71 | @param test Test 72 | */ 73 | - (void)testRunner:(GHTestRunner *)runner didStartTest:(id)test; 74 | 75 | /*! 76 | Test run did update test. 77 | @param runner Runner 78 | @param test Test 79 | */ 80 | - (void)testRunner:(GHTestRunner *)runner didUpdateTest:(id)test; 81 | 82 | /*! 83 | Test run did end test. 84 | @param runner Runner 85 | @param test Test 86 | */ 87 | - (void)testRunner:(GHTestRunner *)runner didEndTest:(id)test; 88 | 89 | /*! 90 | Test run did cancel. 91 | @param runner Runner 92 | */ 93 | - (void)testRunnerDidCancel:(GHTestRunner *)runner; 94 | 95 | /*! 96 | Test run did end. 97 | @param runner Runner 98 | */ 99 | - (void)testRunnerDidEnd:(GHTestRunner *)runner; 100 | 101 | /*! 102 | Test run did log message. 103 | @param runner Runner 104 | @param didLog Message 105 | */ 106 | - (void)testRunner:(GHTestRunner *)runner didLog:(NSString *)didLog; 107 | 108 | /*! 109 | Test run test did log message. 110 | @param runner Runner 111 | @param test Test 112 | @param didLog Message 113 | */ 114 | - (void)testRunner:(GHTestRunner *)runner test:(id)test didLog:(NSString *)didLog; 115 | 116 | @end 117 | 118 | /*! 119 | Runs the tests. 120 | Tests are run a separate thread though delegates are called on the main thread by default. 121 | 122 | For example, 123 | 124 | GHTestRunner *runner = [[GHTestRunner alloc] initWithTest:suite]; 125 | runner.delegate = self; 126 | [runner runTests]; 127 | 128 | */ 129 | @interface GHTestRunner : NSObject { 130 | 131 | id test_; // The test to run; Could be a GHTestGroup (suite), GHTestGroup (test case), or GHTest (target/selector) 132 | 133 | NSObject *__unsafe_unretained delegate_; // weak 134 | 135 | GHTestOptions options_; 136 | 137 | BOOL running_; 138 | BOOL cancelling_; 139 | 140 | NSTimeInterval startInterval_; 141 | 142 | NSOperationQueue *operationQueue_; //! If running a suite in operation queue 143 | } 144 | 145 | @property (strong) id test; 146 | @property (unsafe_unretained) NSObject *delegate; 147 | @property (assign) GHTestOptions options; 148 | @property (readonly) GHTestStats stats; 149 | @property (readonly, getter=isRunning) BOOL running; 150 | @property (readonly, getter=isCancelling) BOOL cancelling; 151 | @property (readonly) NSTimeInterval interval; 152 | @property (strong, nonatomic) NSOperationQueue *operationQueue; 153 | @property (assign, nonatomic, getter=isInParallel) BOOL inParallel; 154 | 155 | /*! 156 | Create runner for test. 157 | @param test Test 158 | */ 159 | - (id)initWithTest:(id)test; 160 | 161 | /*! 162 | Create runner for all tests. 163 | @see [GHTesting loadAllTestCases]. 164 | @result Runner 165 | */ 166 | + (GHTestRunner *)runnerForAllTests; 167 | 168 | /*! 169 | Create runner for test suite. 170 | @param suite Suite 171 | @result Runner 172 | */ 173 | + (GHTestRunner *)runnerForSuite:(GHTestSuite *)suite; 174 | 175 | /*! 176 | Create runner for class and method. 177 | @param testClassName Test class name 178 | @param methodName Test method 179 | @result Runner 180 | */ 181 | + (GHTestRunner *)runnerForTestClassName:(NSString *)testClassName methodName:(NSString *)methodName; 182 | 183 | /*! 184 | Get the runner from the environment. 185 | If the TEST env is set, then we will only run that test case or test method. 186 | */ 187 | + (GHTestRunner *)runnerFromEnv; 188 | 189 | /*! 190 | Run the test runner. Usually called from the test main. 191 | Reads the TEST environment variable and filters on that; or all tests are run. 192 | @result 0 is success, otherwise the failure count 193 | */ 194 | + (int)run; 195 | 196 | /*! 197 | Run in the background. 198 | */ 199 | - (void)runInBackground; 200 | 201 | /*! 202 | Start the test runner. 203 | @result 0 is success, otherwise the failure count 204 | */ 205 | - (int)runTests; 206 | 207 | /*! 208 | Cancel test run. 209 | */ 210 | - (void)cancel; 211 | 212 | /*! 213 | Write message to console. 214 | @param message Message to log 215 | */ 216 | - (void)log:(NSString *)message; 217 | 218 | @end 219 | 220 | //! @endcond 221 | 222 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Headers/GHTestSuite.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHTestSuite.h 3 | // GHUnit 4 | // 5 | // Created by Gabriel Handford on 1/25/09. 6 | // Copyright 2009. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | //! @cond DEV 31 | 32 | #import "GHTestGroup.h" 33 | 34 | /*! 35 | If set, will run it as a "test filter" like the env variable TEST. 36 | */ 37 | extern NSString *GHUnitTest; 38 | 39 | 40 | /*! 41 | Test suite is an alias for test group. 42 | 43 | A test case is an instance of a test case class with test methods. 44 | A test is a id which represents a target and a selector. 45 | A test group is a collection of tests; A collection of id (GHTest or GHTestGroup). 46 | 47 | For example, if you have 2 test cases, GHTestCase1 (with some test methods) and GHTestCase2 (with some test methods), 48 | your test suite might look like: 49 | 50 | "Tests" (GHTestSuite) 51 | GHTestGroup (collection of tests from GHTestCase1) 52 | - (void)testA1 (GHTest with target GHTestCase1 + testA1) 53 | - (void)testA2 (GHTest with target GHTestCase1 + testA2) 54 | GHTestGroup (collection of tests from GHTestCase2) 55 | - (void)testB1; (GHTest with target GHTestCase2 + testB1) 56 | - (void)testB2; (GHTest with target GHTestCase2 + testB2) 57 | 58 | */ 59 | @interface GHTestSuite : GHTestGroup { } 60 | 61 | /*! 62 | Create test suite with test cases. 63 | @param name Label to give the suite 64 | @param testCases Array of init'ed test case classes 65 | @param delegate Delegate 66 | */ 67 | - (id)initWithName:(NSString *)name testCases:(NSArray *)testCases delegate:(id)delegate; 68 | 69 | /*! 70 | Creates a suite of all tests. 71 | Will load all classes that subclass from GHTestCase, SenTestCase or GTMTestCase (or register test case class). 72 | @result Suite 73 | */ 74 | + (GHTestSuite *)allTests; 75 | 76 | /*! 77 | Create suite of tests with filter. 78 | This is useful for running a single test or all tests in a single test case. 79 | 80 | For example, 81 | 'GHSlowTest' -- Runs all test method in GHSlowTest 82 | 'GHSlowTest/testSlowA -- Only runs the test method testSlowA in GHSlowTest 83 | 84 | @param testFilter Test filter 85 | @result Suite 86 | */ 87 | + (GHTestSuite *)suiteWithTestFilter:(NSString *)testFilter; 88 | 89 | /*! 90 | Create suite of tests that start with prefix. 91 | @param prefix If test case class starts with the prefix; If nil or empty string, returns all tests 92 | @param options Compare options 93 | */ 94 | + (GHTestSuite *)suiteWithPrefix:(NSString *)prefix options:(NSStringCompareOptions)options; 95 | 96 | /*! 97 | Suite for a single test/method. 98 | @param testCaseClass Test case class 99 | @param method Method 100 | @result Suite 101 | */ 102 | + (GHTestSuite *)suiteWithTestCaseClass:(Class)testCaseClass method:(SEL)method; 103 | 104 | /*! 105 | Return test suite based on environment (TEST=TestFoo/foo) 106 | @result Suite 107 | */ 108 | + (GHTestSuite *)suiteFromEnv; 109 | 110 | @end 111 | 112 | @interface GHTestSuite (JUnitXML) 113 | 114 | - (BOOL)writeJUnitXMLToDirectory:(NSString *)directory error:(NSError **)error; 115 | 116 | @end 117 | 118 | //! @endcond 119 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Headers/GHTestUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHTestUtils.h 3 | // GHUnitIOS 4 | // 5 | // Created by John Boiles on 10/22/12. 6 | // Copyright 2012. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | #import 31 | 32 | #define GHRunWhile(__CONDITION__) GHRunUntilTimeoutWhileBlock(10.0, ^BOOL{ return (__CONDITION__); }) 33 | 34 | /*! 35 | Run the main run loop for a period of time. This is useful to give views time to 36 | render any asynchronously rendered views. However when possible, GHRunUntilTimeoutWhileBlock 37 | should be used instead since it will provide more determinate output. 38 | 39 | @param interval Interval for the main loop to run 40 | */ 41 | void GHRunForInterval(CFTimeInterval interval); 42 | 43 | /*! 44 | Keep running the main runloop until whileBlock returns NO or timeout is reached. 45 | This is useful for waiting until certain parts of views render. This method should be 46 | used instead of putting GHRunForInterval in a while loop. 47 | 48 | @param timeout Maximum time to run the main loop before giving up 49 | @param whileBlock Block that returns YES if the main runloop should keep running 50 | */ 51 | void GHRunUntilTimeoutWhileBlock(CFTimeInterval timeout, BOOL(^whileBlock)()); 52 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Headers/GHTestViewModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHTest.h 3 | // GHUnit 4 | // 5 | // Created by Gabriel Handford on 1/17/09. 6 | // Copyright 2009. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | //! @cond DEV 31 | 32 | #import "GHTestGroup.h" 33 | #import "GHTestSuite.h" 34 | #import "GHTestRunner.h" 35 | 36 | @class GHTestNode; 37 | 38 | @protocol GHTestNodeDelegate 39 | - (void)testNodeDidChange:(GHTestNode *)node; 40 | @end 41 | 42 | typedef enum { 43 | GHTestNodeFilterNone = 0, 44 | GHTestNodeFilterFailed = 1 45 | } GHTestNodeFilter; 46 | 47 | /*! 48 | Test view model for use in a tree view. 49 | */ 50 | @interface GHTestViewModel : NSObject { 51 | 52 | NSString *identifier_; 53 | GHTestSuite *suite_; 54 | GHTestNode *root_; 55 | 56 | GHTestRunner *runner_; 57 | 58 | NSMutableDictionary *map_; // id#identifier -> GHTestNode 59 | 60 | BOOL editing_; 61 | 62 | NSMutableDictionary *defaults_; 63 | } 64 | 65 | @property (readonly, nonatomic) GHTestNode *root; 66 | @property (assign, nonatomic, getter=isEditing) BOOL editing; 67 | 68 | /*! 69 | Create view model with root test group node. 70 | 71 | @param identifier Unique identifier for test model (used to load defaults) 72 | @param suite Suite 73 | */ 74 | - (id)initWithIdentifier:(NSString *)identifier suite:(GHTestSuite *)suite; 75 | 76 | /*! 77 | @result Name of test suite. 78 | */ 79 | - (NSString *)name; 80 | 81 | /*! 82 | Status description. 83 | 84 | @param prefix Prefix to append 85 | @result Current status string 86 | */ 87 | - (NSString *)statusString:(NSString *)prefix; 88 | 89 | /*! 90 | Find the test node from the test. 91 | 92 | @param test Find test 93 | */ 94 | - (GHTestNode *)findTestNodeForTest:(id)test; 95 | 96 | /*! 97 | Find the first failure. 98 | 99 | @result The first failure 100 | */ 101 | - (GHTestNode *)findFailure; 102 | 103 | /*! 104 | Find the next failure starting from node. 105 | 106 | @param node Node to start from 107 | */ 108 | - (GHTestNode *)findFailureFromNode:(GHTestNode *)node; 109 | 110 | /*! 111 | Register node, so that we can do a lookup later. See findTestNodeForTest:. 112 | 113 | @param node Node to register 114 | */ 115 | - (void)registerNode:(GHTestNode *)node; 116 | 117 | /*! 118 | @result Returns the number of test groups. 119 | */ 120 | - (NSInteger)numberOfGroups; 121 | 122 | /*! 123 | Returns the number of tests in group. 124 | @param group Group number 125 | @result The number of tests in group. 126 | */ 127 | - (NSInteger)numberOfTestsInGroup:(NSInteger)group; 128 | 129 | /*! 130 | Search for path to test. 131 | @param test Test 132 | @result Index path 133 | */ 134 | - (NSIndexPath *)indexPathToTest:(id)test; 135 | 136 | /*! 137 | Load defaults (user settings saved with saveDefaults). 138 | */ 139 | - (void)loadDefaults; 140 | 141 | /*! 142 | Save defaults (user settings to be loaded with loadDefaults). 143 | */ 144 | - (void)saveDefaults; 145 | 146 | /*! 147 | Run with current test suite. 148 | 149 | @param delegate Callback 150 | @param inParallel If YES, will run tests in operation queue 151 | @param options Options 152 | */ 153 | - (void)run:(id)delegate inParallel:(BOOL)inParallel options:(GHTestOptions)options; 154 | 155 | /*! 156 | Cancel test run. 157 | */ 158 | - (void)cancel; 159 | 160 | /*! 161 | Check if running. 162 | 163 | @result YES if running. 164 | */ 165 | - (BOOL)isRunning; 166 | 167 | @end 168 | 169 | 170 | @interface GHTestNode : NSObject { 171 | 172 | id test_; 173 | NSMutableArray */*of GHTestNode*/children_; 174 | NSMutableArray */* of GHTestNode*/filteredChildren_; 175 | 176 | id __unsafe_unretained delegate_; 177 | GHTestNodeFilter filter_; 178 | NSString *textFilter_; 179 | } 180 | 181 | @property (readonly, strong, nonatomic) NSArray */* of GHTestNode*/children; 182 | @property (readonly, strong, nonatomic) id test; 183 | @property (unsafe_unretained, nonatomic) id delegate; 184 | @property (assign, nonatomic) GHTestNodeFilter filter; 185 | @property (strong, nonatomic) NSString *textFilter; 186 | 187 | - (id)initWithTest:(id)test children:(NSArray */*of id*/)children source:(GHTestViewModel *)source; 188 | + (GHTestNode *)nodeWithTest:(id)test children:(NSArray */*of id*/)children source:(GHTestViewModel *)source; 189 | 190 | - (NSString *)identifier; 191 | - (NSString *)name; 192 | - (NSString *)nameWithStatus; 193 | 194 | - (GHTestStatus)status; 195 | - (NSString *)statusString; 196 | - (NSString *)stackTrace; 197 | - (NSString *)exceptionFilename; 198 | - (NSInteger)exceptionLineNumber; 199 | - (NSString *)log; 200 | - (BOOL)isRunning; 201 | - (BOOL)isDisabled; 202 | - (BOOL)isHidden; 203 | - (BOOL)isEnded; 204 | - (BOOL)isGroupTest; // YES if test has "sub tests" 205 | 206 | - (BOOL)isSelected; 207 | - (void)setSelected:(BOOL)selected; 208 | 209 | - (BOOL)hasChildren; 210 | - (BOOL)failed; 211 | 212 | - (void)notifyChanged; 213 | 214 | - (void)setFilter:(GHTestNodeFilter)filter textFilter:(NSString *)textFilter; 215 | 216 | @end 217 | 218 | //! @endcond 219 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Headers/GHTesting.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHTesting.h 3 | // GHUnit 4 | // 5 | // Created by Gabriel Handford on 1/30/09. 6 | // Copyright 2008 Gabriel Handford 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | //! @cond DEV 31 | 32 | // 33 | // Portions of this file fall under the following license, marked with: 34 | // GTM_BEGIN : GTM_END 35 | // 36 | // Copyright 2008 Google Inc. 37 | // 38 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not 39 | // use this file except in compliance with the License. You may obtain a copy 40 | // of the License at 41 | // 42 | // http://www.apache.org/licenses/LICENSE-2.0 43 | // 44 | // Unless required by applicable law or agreed to in writing, software 45 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 46 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 47 | // License for the specific language governing permissions and limitations under 48 | // the License. 49 | // 50 | 51 | #import 52 | #import "GHUnit.h" 53 | 54 | 55 | // GTM_BEGIN 56 | BOOL isTestFixtureOfClass(Class aClass, Class testCaseClass); 57 | // GTM_END 58 | 59 | /*! 60 | Utility test for loading and running tests. 61 | 62 | Much of this is borrowed from GTM/UnitTesting. 63 | */ 64 | @interface GHTesting : NSObject { 65 | 66 | NSMutableArray/* of NSString*/ *testCaseClassNames_; 67 | 68 | } 69 | 70 | /*! 71 | The shared testing instance. 72 | */ 73 | + (GHTesting *)sharedInstance; 74 | 75 | /*! 76 | Load all test classes that we can "see". 77 | @result Array of initialized (and autoreleased) test case classes in an autoreleased array. 78 | */ 79 | - (NSArray *)loadAllTestCases; 80 | 81 | /*! 82 | Load tests from target. 83 | @param target Target 84 | @result Array of id 85 | */ 86 | - (NSArray *)loadTestsFromTarget:(id)target; 87 | 88 | /*! 89 | See if class is of a registered test case class. 90 | @param aClass Class 91 | */ 92 | - (BOOL)isTestCaseClass:(Class)aClass; 93 | 94 | /*! 95 | Register test case class. 96 | @param aClass Class 97 | */ 98 | - (void)registerClass:(Class)aClass; 99 | 100 | /*! 101 | Register test case class by name. 102 | @param className Class name (via NSStringFromClass(aClass) 103 | */ 104 | - (void)registerClassName:(NSString *)className; 105 | 106 | /*! 107 | Format test exception. 108 | @param exception Exception 109 | @result Description 110 | */ 111 | + (NSString *)descriptionForException:(NSException *)exception; 112 | 113 | /*! 114 | Filename for cause of test exception. 115 | @param test Test 116 | @result Filename 117 | */ 118 | + (NSString *)exceptionFilenameForTest:(id)test; 119 | 120 | /*! 121 | Line number for cause of test exception. 122 | @param test Test 123 | @result Line number 124 | */ 125 | + (NSInteger)exceptionLineNumberForTest:(id)test; 126 | 127 | /*! 128 | Run test. 129 | @param target Target 130 | @param selector Selector 131 | @param exception Exception, if set, is retained and should be released by the caller. 132 | @param interval Time to run the test 133 | @param reraiseExceptions If YES, will re-raise exceptions 134 | */ 135 | + (BOOL)runTestWithTarget:(id)target selector:(SEL)selector exception:(NSException **)exception 136 | interval:(NSTimeInterval *)interval reraiseExceptions:(BOOL)reraiseExceptions; 137 | 138 | /*! 139 | Same as normal runTest without catching exceptions. 140 | @param target Target 141 | @param selector Selector 142 | @param exception Exception, if set, is retained and should be released by the caller. 143 | @param interval Time to run the test 144 | */ 145 | + (BOOL)runTestOrRaiseWithTarget:(id)target selector:(SEL)selector exception:(NSException **)exception interval:(NSTimeInterval *)interval; 146 | 147 | @end 148 | 149 | @protocol GHSenTestCase 150 | - (void)raiseAfterFailure; 151 | @end 152 | 153 | //! @endcond 154 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Headers/GHUIImageViewControl.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHUIImageViewControl.h 3 | // GHUnitIOS 4 | // 5 | // Created by Gabriel Handford on 4/1/11. 6 | // Copyright 2011. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | #import 31 | 32 | @interface GHUIImageViewControl : UIControl { 33 | UIImageView *_imageView; 34 | } 35 | 36 | @property (readonly, nonatomic) UIImageView *imageView; 37 | @property (nonatomic) UIImage *image; 38 | 39 | - (id)initWithFrame:(CGRect)frame image:(UIImage *)image highlightedImage:(UIImage *)highlightedImage; 40 | 41 | @end -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Headers/GHUnit.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHUnit.h 3 | // GHUnit 4 | // 5 | // Created by Gabriel Handford on 1/19/09. 6 | // Copyright 2009. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | #import "GHTestCase.h" 31 | #import "GHAsyncTestCase.h" 32 | #import "GHTestSuite.h" 33 | #import "GHTestMacros.h" 34 | #import "GHTestRunner.h" 35 | 36 | #import "GHTest.h" 37 | #import "GHTesting.h" 38 | #import "GHTestOperation.h" 39 | #import "GHTestGroup.h" 40 | #import "GHTest+JUnitXML.h" 41 | #import "GHTestGroup+JUnitXML.h" 42 | #import "GHTestUtils.h" 43 | #import "NSException+GHTestFailureExceptions.h" 44 | #import "NSValue+GHValueFormatter.h" 45 | 46 | #if TARGET_OS_IPHONE 47 | #import "GHUnitIOSAppDelegate.h" 48 | #import "GHViewTestCase.h" 49 | #endif 50 | 51 | #ifdef DEBUG 52 | #define GHUDebug(fmt, ...) do { \ 53 | fputs([[[NSString stringWithFormat:fmt, ##__VA_ARGS__] stringByAppendingString:@"\n"] UTF8String], stdout); \ 54 | } while(0) 55 | #else 56 | #define GHUDebug(fmt, ...) do {} while(0) 57 | #endif 58 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Headers/GHUnitIOSAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHUnitIOSAppDelegate.h 3 | // GHUnitIOS 4 | // 5 | // Created by Gabriel Handford on 1/25/09. 6 | // Copyright 2009. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | #import 31 | 32 | /*! 33 | Application delegate for the iOS test application. 34 | */ 35 | @interface GHUnitIOSAppDelegate : NSObject { 36 | UIWindow *window_; 37 | 38 | UINavigationController *navigationController_; 39 | } 40 | 41 | @end 42 | 43 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Headers/GHUnitIOSTableViewDataSource.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHUnitIOSTableViewDataSource.h 3 | // GHUnitIOS 4 | // 5 | // Created by Gabriel Handford on 5/5/09. 6 | // Copyright 2009. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | #import 31 | #import "GHTestViewModel.h" 32 | 33 | /* 34 | Table view data source for iOS test application. 35 | */ 36 | @interface GHUnitIOSTableViewDataSource : GHTestViewModel { 37 | 38 | } 39 | 40 | - (GHTestNode *)nodeForIndexPath:(NSIndexPath *)indexPath; 41 | 42 | - (void)setSelectedForAllNodes:(BOOL)selected; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Headers/GHUnitIOSTestView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHUnitIOSTestView.h 3 | // GHUnitIOS 4 | // 5 | // Created by John Boiles on 8/8/11. 6 | // Copyright 2011. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | #import 31 | #import "GHUIImageViewControl.h" 32 | 33 | @class GHUnitIOSTestView; 34 | 35 | @protocol GHUnitIOSTestViewDelegate 36 | - (void)testViewDidSelectSavedImage:(GHUnitIOSTestView *)testView; 37 | - (void)testViewDidSelectRenderedImage:(GHUnitIOSTestView *)testView; 38 | - (void)testViewDidApproveChange:(GHUnitIOSTestView *)testView; 39 | @end 40 | 41 | @interface GHUnitIOSTestView : UIScrollView { 42 | id __unsafe_unretained controlDelegate_; 43 | 44 | // TODO(johnb): Perhaps hold a scrollview here as subclassing UIViews can be weird. 45 | 46 | GHUIImageViewControl *savedImageView_; 47 | GHUIImageViewControl *renderedImageView_; 48 | 49 | UIButton *approveButton_; 50 | 51 | UILabel *textLabel_; 52 | } 53 | @property(unsafe_unretained, nonatomic) id controlDelegate; 54 | 55 | - (void)setSavedImage:(UIImage *)savedImage renderedImage:(UIImage *)renderedImage text:(NSString *)text; 56 | 57 | - (void)setText:(NSString *)text; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Headers/GHUnitIOSTestViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHUnitIOSTestViewController.h 3 | // GHUnitIOS 4 | // 5 | // Created by Gabriel Handford on 2/20/09. 6 | // Copyright 2009. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | #import 31 | #import "GHTestViewModel.h" 32 | #import "GHUnitIOSTestView.h" 33 | #import "GHImageDiffView.h" 34 | 35 | /* 36 | View controller for a test. 37 | */ 38 | @interface GHUnitIOSTestViewController : UIViewController { 39 | GHUnitIOSTestView *testView_; 40 | GHImageDiffView *imageDiffView_; 41 | 42 | GHTestNode *testNode_; 43 | 44 | GHTestRunner *runner_; 45 | } 46 | 47 | - (void)setTest:(id)test; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Headers/GHUnitIOSView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHUnitIOSView.h 3 | // GHUnitIOS 4 | // 5 | // Created by Gabriel Handford on 4/12/10. 6 | // Copyright 2010. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | #import 31 | #import 32 | 33 | /* 34 | Main view for iOS test application. 35 | */ 36 | @interface GHUnitIOSView : UIView { 37 | UISearchBar *searchBar_; 38 | 39 | UITableView *tableView_; 40 | 41 | //! Status label at bottom of the view 42 | UILabel *statusLabel_; 43 | 44 | UISegmentedControl *filterControl_; 45 | 46 | UIToolbar *runToolbar_; 47 | 48 | UIView *footerView_; 49 | } 50 | 51 | @property (readonly, nonatomic) UILabel *statusLabel; 52 | @property (readonly, nonatomic) UISegmentedControl *filterControl; 53 | @property (readonly, nonatomic) UISearchBar *searchBar; 54 | @property (readonly, nonatomic) UITableView *tableView; 55 | 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Headers/GHUnitIOSViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHUnitIOSViewController.h 3 | // GHUnitIOS 4 | // 5 | // Created by Gabriel Handford on 1/25/09. 6 | // Copyright 2009. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | #import "GHUnitIOSView.h" 31 | 32 | #import "GHUnitIOSTableViewDataSource.h" 33 | #import "GHUnitIOSTestViewController.h" 34 | 35 | /* 36 | Main view controller for the iOS test application. 37 | */ 38 | @interface GHUnitIOSViewController : UIViewController { 39 | 40 | GHUnitIOSView *view_; 41 | 42 | GHUnitIOSTableViewDataSource *dataSource_; 43 | GHTestSuite *suite_; 44 | 45 | UIBarButtonItem *runButton_; 46 | 47 | // If set then we will no longer auto scroll as tests are run 48 | BOOL userDidDrag_; 49 | 50 | } 51 | 52 | @property (strong, nonatomic) GHTestSuite *suite; 53 | 54 | - (void)reloadTest:(id)test; 55 | 56 | - (void)scrollToTest:(id)test; 57 | - (void)scrollToBottom; 58 | 59 | - (void)setStatusText:(NSString *)message; 60 | 61 | - (void)runTests; 62 | 63 | - (void)cancel; 64 | 65 | - (void)reload; 66 | 67 | - (void)loadDefaults; 68 | - (void)saveDefaults; 69 | 70 | - (GHUnitIOSTableViewDataSource *)dataSource; 71 | 72 | @end 73 | 74 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Headers/GHUnitIPhoneAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHUnitIPhoneAppDelegate.h 3 | // GHUnitIOS 4 | // 5 | // Created by Gabriel Handford on 6/28/11. 6 | // 7 | // Permission is hereby granted, free of charge, to any person 8 | // obtaining a copy of this software and associated documentation 9 | // files (the "Software"), to deal in the Software without 10 | // restriction, including without limitation the rights to use, 11 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the 13 | // Software is furnished to do so, subject to the following 14 | // conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be 17 | // included in all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | // OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | #import "GHUnitIOSAppDelegate.h" 30 | 31 | // For backwards compatibility (see GHUnitIOSAppDelegate) 32 | @interface GHUnitIPhoneAppDelegate : GHUnitIOSAppDelegate { 33 | 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Headers/GHViewTestCase.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHViewTestCase.h 3 | // GHUnitIOS 4 | // 5 | // Created by John Boiles on 10/20/11. 6 | // Copyright (c) 2011. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | #import "GHTestCase.h" 31 | #import 32 | 33 | /*! 34 | Assert that a view has not changed. Raises exception if the view has changed or if 35 | no image exists from previous test runs. 36 | 37 | @param view The view to verify 38 | */ 39 | #define GHVerifyView(view) \ 40 | do { \ 41 | if (![self isKindOfClass:[GHViewTestCase class]]) \ 42 | [[NSException ghu_failureWithName:@"GHInvalidTestException" \ 43 | inFile:[NSString stringWithUTF8String:__FILE__] \ 44 | atLine:__LINE__ \ 45 | reason:@"GHVerifyView can only be called from within a GHViewTestCase class"] raise]; \ 46 | [self verifyView:view filename:[NSString stringWithUTF8String:__FILE__] lineNumber:__LINE__]; \ 47 | } while (0) 48 | 49 | /*! 50 | View verification test case. 51 | 52 | Supports GHVerifyView, which renders a view and compares it against a saved 53 | image from a previous test run. 54 | 55 | @interface MyViewTest : GHViewTestCase { } 56 | @end 57 | 58 | @implementation MyViewTest 59 | 60 | - (void)testMyView { 61 | MyView *myView = [[MyView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]; 62 | GHVerifyView(myView); 63 | } 64 | 65 | @end 66 | 67 | In order to record results across test runs, the PrepareUITests.sh script needs 68 | to be run as a build step. This script copies any test images (saved locally in 69 | $PROJECT_DIR/TestImages) to the app bundle so that calls to GHVerifyView have 70 | images from previous runs with which to compare. 71 | 72 | After changes to views are approved in the simulator, the CopyTestImages.sh script 73 | should be run manually in Terminal. This script copies any approved view changes 74 | back to the project directory. Images are saved with filenames of the following format: 75 | 76 | [test class name]-[test selector name]-[UIScreen scale]-[# of call to GHVerifyView in selector]-[view class name].png 77 | 78 | Note that because of differences in text rendering between retina and non-retina 79 | devices/simulators, different images are saved for test runs using retina then 80 | non-retina. 81 | 82 | Also note that there are commonly rendering differences across iOS versions. 83 | Therefore it is common for tests to fail when they are run using a different iOS 84 | version then the one that created the saved test image. This also applies to tests 85 | that are run at the command line (the xcodebuild flag '-sdk iphonesimulator' 86 | usually corresponds to the latest iOS simulator available). 87 | */ 88 | @interface GHViewTestCase : GHTestCase { 89 | NSInteger imageVerifyCount_; 90 | } 91 | 92 | /*! 93 | Clear all test images in the documents directory. 94 | */ 95 | + (void)clearTestImages; 96 | 97 | /*! 98 | Creates a UIImage from the passed in view. This can be useful for testing 99 | views that require images. 100 | 101 | @param view UIView to render 102 | @result UIImage of the rendered UIView 103 | */ 104 | + (UIImage *)imageWithView:(UIView *)view; 105 | 106 | /*! 107 | Save an approved view test image to the view test images directory. 108 | 109 | @param image Image to save 110 | @param filename Filename for the saved image 111 | */ 112 | + (void)saveApprovedViewTestImage:(UIImage *)image filename:(NSString *)filename; 113 | 114 | /*! 115 | Size for a given view. Subclasses can override this to provide custom sizes 116 | for views before rendering. The default implementation returns contentSize 117 | for scrollviews and returns self.frame.size for all other views. 118 | 119 | @param view View for which to calculate the size 120 | @result Size at which the view should be rendered 121 | */ 122 | - (CGSize)sizeForView:(UIView *)view; 123 | 124 | /*! 125 | Called from the GHVerifyView macro. This method should not be called manually. 126 | Verifies that a view hasn't changed since the last time it was approved. Raises 127 | a GHViewChangeException if the view has changed. Raises a GHViewUnavailableException 128 | if there is no image from a previous run. 129 | 130 | @param view View to verify 131 | @param filename Filename of the call to GHVerifyView 132 | @param lineNumber Line number of the call to GHVerifyView 133 | */ 134 | - (void)verifyView:(UIView *)view filename:(NSString *)filename lineNumber:(int)lineNumber; 135 | 136 | @end 137 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Headers/NSException+GHTestFailureExceptions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSException+GHTestFailureExceptions.h 3 | // 4 | // Created by Johannes Rudolph on 23.09.09. 5 | // Copyright 2009. All rights reserved. 6 | // 7 | // Permission is hereby granted, free of charge, to any person 8 | // obtaining a copy of this software and associated documentation 9 | // files (the "Software"), to deal in the Software without 10 | // restriction, including without limitation the rights to use, 11 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the 13 | // Software is furnished to do so, subject to the following 14 | // conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be 17 | // included in all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | // OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | //! @cond DEV 30 | 31 | // 32 | // Portions of this file fall under the following license, marked with: 33 | // GTM_BEGIN : GTM_END 34 | // 35 | // Copyright 2008 Google Inc. 36 | // 37 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not 38 | // use this file except in compliance with the License. You may obtain a copy 39 | // of the License at 40 | // 41 | // http://www.apache.org/licenses/LICENSE-2.0 42 | // 43 | // Unless required by applicable law or agreed to in writing, software 44 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 45 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 46 | // License for the specific language governing permissions and limitations under 47 | // the License. 48 | // 49 | 50 | extern NSString *const GHTestFilenameKey; 51 | extern NSString *const GHTestLineNumberKey; 52 | extern NSString *const GHTestFailureException; 53 | 54 | 55 | // GTM_BEGIN 56 | 57 | #import 58 | 59 | @interface NSException(GHUTestFailureExceptions) 60 | + (NSException *)ghu_failureInFile:(NSString *)filename 61 | atLine:(int)lineNumber 62 | withDescription:(NSString *)formatString, ...; 63 | + (NSException *)ghu_failureInCondition:(NSString *)condition 64 | isTrue:(BOOL)isTrue 65 | inFile:(NSString *)filename 66 | atLine:(int)lineNumber 67 | withDescription:(NSString *)formatString, ...; 68 | + (NSException *)ghu_failureInEqualityBetweenObject:(id)left 69 | andObject:(id)right 70 | inFile:(NSString *)filename 71 | atLine:(int)lineNumber 72 | withDescription:(NSString *)formatString, ...; 73 | + (NSException *)ghu_failureInInequalityBetweenObject:(id)left 74 | andObject:(id)right 75 | inFile:(NSString *)filename 76 | atLine:(int)lineNumber 77 | withDescription:(NSString *)formatString, ...; 78 | + (NSException *)ghu_failureInEqualityBetweenValue:(NSValue *)left 79 | andValue:(NSValue *)right 80 | withAccuracy:(NSValue *)accuracy 81 | inFile:(NSString *)filename 82 | atLine:(int) ineNumber 83 | withDescription:(NSString *)formatString, ...; 84 | + (NSException *)ghu_failureInRaise:(NSString *)expression 85 | inFile:(NSString *)filename 86 | atLine:(int)lineNumber 87 | withDescription:(NSString *)formatString, ...; 88 | + (NSException *)ghu_failureInRaise:(NSString *)expression 89 | exception:(NSException *)exception 90 | inFile:(NSString *)filename 91 | atLine:(int)lineNumber 92 | withDescription:(NSString *)formatString, ...; 93 | @end 94 | 95 | // GTM_END 96 | 97 | //! @endcond 98 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Headers/NSValue+GHValueFormatter.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSValue+GHValueFormatter.h 3 | // 4 | // Created by Johannes Rudolph on 23.9.2009. 5 | // Copyright 2009. All rights reserved. 6 | // 7 | // Permission is hereby granted, free of charge, to any person 8 | // obtaining a copy of this software and associated documentation 9 | // files (the "Software"), to deal in the Software without 10 | // restriction, including without limitation the rights to use, 11 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the 13 | // Software is furnished to do so, subject to the following 14 | // conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be 17 | // included in all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | // OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | //! @cond DEV 30 | 31 | // 32 | // Portions of this file fall under the following license, marked with 33 | // SENTE_BEGIN - SENTE_END 34 | // 35 | // Copyright (c) 1997-2005, Sen:te (Sente SA). All rights reserved. 36 | // 37 | // Use of this source code is governed by the following license: 38 | // 39 | // Redistribution and use in source and binary forms, with or without modification, 40 | // are permitted provided that the following conditions are met: 41 | // 42 | // (1) Redistributions of source code must retain the above copyright notice, 43 | // this list of conditions and the following disclaimer. 44 | // 45 | // (2) Redistributions in binary form must reproduce the above copyright notice, 46 | // this list of conditions and the following disclaimer in the documentation 47 | // and/or other materials provided with the distribution. 48 | // 49 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 50 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 51 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 52 | // IN NO EVENT SHALL Sente SA OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 53 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 54 | // OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 55 | // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 56 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 57 | // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 58 | // 59 | // Note: this license is equivalent to the FreeBSD license. 60 | // 61 | // This notice may not be removed from this file. 62 | 63 | #import 64 | 65 | // SENTE_BEGIN 66 | @interface NSValue(GHValueFormatter) 67 | - (NSString *)ghu_contentDescription; 68 | @end 69 | // SENTE_END 70 | 71 | //! @endcond 72 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleIdentifier 8 | me.rel.ghunit 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundlePackageType 12 | FMWK 13 | CFBundleSignature 14 | ???? 15 | CFBundleVersion 16 | $(GHUNIT_VERSION) 17 | 18 | 19 | -------------------------------------------------------------------------------- /MailcheckDemo/GHUnitIOS.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /MailcheckDemo/MailcheckDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | archiveVersion 6 | 1 7 | classes 8 | 9 | objectVersion 10 | 46 11 | objects 12 | 13 | 04D669078AEF049888F08A70 14 | 15 | children 16 | 17 | BFEF32E1652B7E92E25939CE 18 | 650D90134B53CD8D179BCC84 19 | 20 | isa 21 | PBXGroup 22 | name 23 | Pods 24 | sourceTree 25 | <group> 26 | 27 | 3E6AD84DA7D74B869324F19E 28 | 29 | buildActionMask 30 | 2147483647 31 | files 32 | 33 | inputPaths 34 | 35 | isa 36 | PBXShellScriptBuildPhase 37 | name 38 | Check Pods Manifest.lock 39 | outputPaths 40 | 41 | runOnlyForDeploymentPostprocessing 42 | 0 43 | shellPath 44 | /bin/sh 45 | shellScript 46 | diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null 47 | if [[ $? != 0 ]] ; then 48 | cat << EOM 49 | error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation. 50 | EOM 51 | exit 1 52 | fi 53 | 54 | showEnvVarsInLog 55 | 0 56 | 57 | 43BB78A9A5344A499B3B8BBA 58 | 59 | fileRef 60 | 74459E94E2ED460EB0F22F61 61 | isa 62 | PBXBuildFile 63 | 64 | 63A13F12169631EE007BB27E 65 | 66 | children 67 | 68 | 63B79CCE169640D6009EBA25 69 | 63A13F27169631EE007BB27E 70 | 63A13F4716963253007BB27E 71 | 63A13F20169631EE007BB27E 72 | 63A13F1E169631EE007BB27E 73 | 04D669078AEF049888F08A70 74 | 75 | isa 76 | PBXGroup 77 | sourceTree 78 | <group> 79 | 80 | 63A13F14169631EE007BB27E 81 | 82 | attributes 83 | 84 | LastUpgradeCheck 85 | 0450 86 | ORGANIZATIONNAME 87 | David Kasper 88 | 89 | buildConfigurationList 90 | 63A13F17169631EE007BB27E 91 | compatibilityVersion 92 | Xcode 3.2 93 | developmentRegion 94 | English 95 | hasScannedForEncodings 96 | 0 97 | isa 98 | PBXProject 99 | knownRegions 100 | 101 | en 102 | 103 | mainGroup 104 | 63A13F12169631EE007BB27E 105 | productRefGroup 106 | 63A13F1E169631EE007BB27E 107 | projectDirPath 108 | 109 | projectReferences 110 | 111 | projectRoot 112 | 113 | targets 114 | 115 | 63A13F1C169631EE007BB27E 116 | 63A13F4116963253007BB27E 117 | 118 | 119 | 63A13F17169631EE007BB27E 120 | 121 | buildConfigurations 122 | 123 | 63A13F39169631EF007BB27E 124 | 63A13F3A169631EF007BB27E 125 | 126 | defaultConfigurationIsVisible 127 | 0 128 | defaultConfigurationName 129 | Release 130 | isa 131 | XCConfigurationList 132 | 133 | 63A13F19169631EE007BB27E 134 | 135 | buildActionMask 136 | 2147483647 137 | files 138 | 139 | 63A13F2E169631EE007BB27E 140 | F772D5BC18A6B76900FDC6BA 141 | 63A13F32169631EE007BB27E 142 | 143 | isa 144 | PBXSourcesBuildPhase 145 | runOnlyForDeploymentPostprocessing 146 | 0 147 | 148 | 63A13F1A169631EE007BB27E 149 | 150 | buildActionMask 151 | 2147483647 152 | files 153 | 154 | 63A13F22169631EE007BB27E 155 | 63A13F24169631EE007BB27E 156 | 63A13F26169631EE007BB27E 157 | 43BB78A9A5344A499B3B8BBA 158 | 159 | isa 160 | PBXFrameworksBuildPhase 161 | runOnlyForDeploymentPostprocessing 162 | 0 163 | 164 | 63A13F1B169631EE007BB27E 165 | 166 | buildActionMask 167 | 2147483647 168 | files 169 | 170 | 63A13F2C169631EE007BB27E 171 | 63A13F34169631EE007BB27E 172 | 63A13F36169631EF007BB27E 173 | 63A13F38169631EF007BB27E 174 | 175 | isa 176 | PBXResourcesBuildPhase 177 | runOnlyForDeploymentPostprocessing 178 | 0 179 | 180 | 63A13F1C169631EE007BB27E 181 | 182 | buildConfigurationList 183 | 63A13F3B169631EF007BB27E 184 | buildPhases 185 | 186 | 3E6AD84DA7D74B869324F19E 187 | 63A13F19169631EE007BB27E 188 | 63A13F1A169631EE007BB27E 189 | 63A13F1B169631EE007BB27E 190 | FE56F2B2FE34434295E48B3B 191 | 192 | buildRules 193 | 194 | dependencies 195 | 196 | isa 197 | PBXNativeTarget 198 | name 199 | MailcheckDemo 200 | productName 201 | MailcheckDemo 202 | productReference 203 | 63A13F1D169631EE007BB27E 204 | productType 205 | com.apple.product-type.application 206 | 207 | 63A13F1D169631EE007BB27E 208 | 209 | explicitFileType 210 | wrapper.application 211 | includeInIndex 212 | 0 213 | isa 214 | PBXFileReference 215 | path 216 | MailcheckDemo.app 217 | sourceTree 218 | BUILT_PRODUCTS_DIR 219 | 220 | 63A13F1E169631EE007BB27E 221 | 222 | children 223 | 224 | 63A13F1D169631EE007BB27E 225 | 63A13F4216963253007BB27E 226 | 227 | isa 228 | PBXGroup 229 | name 230 | Products 231 | sourceTree 232 | <group> 233 | 234 | 63A13F20169631EE007BB27E 235 | 236 | children 237 | 238 | 63A13F5C1696330A007BB27E 239 | 63A13F21169631EE007BB27E 240 | 63A13F23169631EE007BB27E 241 | 63A13F25169631EE007BB27E 242 | 74459E94E2ED460EB0F22F61 243 | 244 | isa 245 | PBXGroup 246 | name 247 | Frameworks 248 | sourceTree 249 | <group> 250 | 251 | 63A13F21169631EE007BB27E 252 | 253 | isa 254 | PBXFileReference 255 | lastKnownFileType 256 | wrapper.framework 257 | name 258 | UIKit.framework 259 | path 260 | System/Library/Frameworks/UIKit.framework 261 | sourceTree 262 | SDKROOT 263 | 264 | 63A13F22169631EE007BB27E 265 | 266 | fileRef 267 | 63A13F21169631EE007BB27E 268 | isa 269 | PBXBuildFile 270 | 271 | 63A13F23169631EE007BB27E 272 | 273 | isa 274 | PBXFileReference 275 | lastKnownFileType 276 | wrapper.framework 277 | name 278 | Foundation.framework 279 | path 280 | System/Library/Frameworks/Foundation.framework 281 | sourceTree 282 | SDKROOT 283 | 284 | 63A13F24169631EE007BB27E 285 | 286 | fileRef 287 | 63A13F23169631EE007BB27E 288 | isa 289 | PBXBuildFile 290 | 291 | 63A13F25169631EE007BB27E 292 | 293 | isa 294 | PBXFileReference 295 | lastKnownFileType 296 | wrapper.framework 297 | name 298 | CoreGraphics.framework 299 | path 300 | System/Library/Frameworks/CoreGraphics.framework 301 | sourceTree 302 | SDKROOT 303 | 304 | 63A13F26169631EE007BB27E 305 | 306 | fileRef 307 | 63A13F25169631EE007BB27E 308 | isa 309 | PBXBuildFile 310 | 311 | 63A13F27169631EE007BB27E 312 | 313 | children 314 | 315 | F772D5BA18A6B76900FDC6BA 316 | F772D5BB18A6B76900FDC6BA 317 | 63A13F30169631EE007BB27E 318 | 63A13F31169631EE007BB27E 319 | 63A13F28169631EE007BB27E 320 | 321 | isa 322 | PBXGroup 323 | path 324 | MailcheckDemo 325 | sourceTree 326 | <group> 327 | 328 | 63A13F28169631EE007BB27E 329 | 330 | children 331 | 332 | 63A13F29169631EE007BB27E 333 | 63A13F2A169631EE007BB27E 334 | 63A13F2D169631EE007BB27E 335 | 63A13F2F169631EE007BB27E 336 | 63A13F33169631EE007BB27E 337 | 63A13F35169631EF007BB27E 338 | 63A13F37169631EF007BB27E 339 | 340 | isa 341 | PBXGroup 342 | name 343 | Supporting Files 344 | sourceTree 345 | <group> 346 | 347 | 63A13F29169631EE007BB27E 348 | 349 | isa 350 | PBXFileReference 351 | lastKnownFileType 352 | text.plist.xml 353 | path 354 | MailcheckDemo-Info.plist 355 | sourceTree 356 | <group> 357 | 358 | 63A13F2A169631EE007BB27E 359 | 360 | children 361 | 362 | 63A13F2B169631EE007BB27E 363 | 364 | isa 365 | PBXVariantGroup 366 | name 367 | InfoPlist.strings 368 | sourceTree 369 | <group> 370 | 371 | 63A13F2B169631EE007BB27E 372 | 373 | isa 374 | PBXFileReference 375 | lastKnownFileType 376 | text.plist.strings 377 | name 378 | en 379 | path 380 | en.lproj/InfoPlist.strings 381 | sourceTree 382 | <group> 383 | 384 | 63A13F2C169631EE007BB27E 385 | 386 | fileRef 387 | 63A13F2A169631EE007BB27E 388 | isa 389 | PBXBuildFile 390 | 391 | 63A13F2D169631EE007BB27E 392 | 393 | isa 394 | PBXFileReference 395 | lastKnownFileType 396 | sourcecode.c.objc 397 | path 398 | main.m 399 | sourceTree 400 | <group> 401 | 402 | 63A13F2E169631EE007BB27E 403 | 404 | fileRef 405 | 63A13F2D169631EE007BB27E 406 | isa 407 | PBXBuildFile 408 | 409 | 63A13F2F169631EE007BB27E 410 | 411 | isa 412 | PBXFileReference 413 | lastKnownFileType 414 | sourcecode.c.h 415 | path 416 | MailcheckDemo-Prefix.pch 417 | sourceTree 418 | <group> 419 | 420 | 63A13F30169631EE007BB27E 421 | 422 | isa 423 | PBXFileReference 424 | lastKnownFileType 425 | sourcecode.c.h 426 | path 427 | AppDelegate.h 428 | sourceTree 429 | <group> 430 | 431 | 63A13F31169631EE007BB27E 432 | 433 | isa 434 | PBXFileReference 435 | lastKnownFileType 436 | sourcecode.c.objc 437 | path 438 | AppDelegate.m 439 | sourceTree 440 | <group> 441 | 442 | 63A13F32169631EE007BB27E 443 | 444 | fileRef 445 | 63A13F31169631EE007BB27E 446 | isa 447 | PBXBuildFile 448 | 449 | 63A13F33169631EE007BB27E 450 | 451 | isa 452 | PBXFileReference 453 | lastKnownFileType 454 | image.png 455 | path 456 | Default.png 457 | sourceTree 458 | <group> 459 | 460 | 63A13F34169631EE007BB27E 461 | 462 | fileRef 463 | 63A13F33169631EE007BB27E 464 | isa 465 | PBXBuildFile 466 | 467 | 63A13F35169631EF007BB27E 468 | 469 | isa 470 | PBXFileReference 471 | lastKnownFileType 472 | image.png 473 | path 474 | Default@2x.png 475 | sourceTree 476 | <group> 477 | 478 | 63A13F36169631EF007BB27E 479 | 480 | fileRef 481 | 63A13F35169631EF007BB27E 482 | isa 483 | PBXBuildFile 484 | 485 | 63A13F37169631EF007BB27E 486 | 487 | isa 488 | PBXFileReference 489 | lastKnownFileType 490 | image.png 491 | path 492 | Default-568h@2x.png 493 | sourceTree 494 | <group> 495 | 496 | 63A13F38169631EF007BB27E 497 | 498 | fileRef 499 | 63A13F37169631EF007BB27E 500 | isa 501 | PBXBuildFile 502 | 503 | 63A13F39169631EF007BB27E 504 | 505 | buildSettings 506 | 507 | ALWAYS_SEARCH_USER_PATHS 508 | NO 509 | CLANG_CXX_LANGUAGE_STANDARD 510 | gnu++0x 511 | CLANG_CXX_LIBRARY 512 | libc++ 513 | CLANG_ENABLE_OBJC_ARC 514 | YES 515 | CLANG_WARN_EMPTY_BODY 516 | YES 517 | CLANG_WARN__DUPLICATE_METHOD_MATCH 518 | YES 519 | CODE_SIGN_IDENTITY[sdk=iphoneos*] 520 | iPhone Developer 521 | COPY_PHASE_STRIP 522 | NO 523 | GCC_C_LANGUAGE_STANDARD 524 | gnu99 525 | GCC_DYNAMIC_NO_PIC 526 | NO 527 | GCC_OPTIMIZATION_LEVEL 528 | 0 529 | GCC_PREPROCESSOR_DEFINITIONS 530 | 531 | DEBUG=1 532 | $(inherited) 533 | 534 | GCC_SYMBOLS_PRIVATE_EXTERN 535 | NO 536 | GCC_WARN_ABOUT_RETURN_TYPE 537 | YES 538 | GCC_WARN_UNINITIALIZED_AUTOS 539 | YES 540 | GCC_WARN_UNUSED_VARIABLE 541 | YES 542 | IPHONEOS_DEPLOYMENT_TARGET 543 | 6.0 544 | ONLY_ACTIVE_ARCH 545 | YES 546 | SDKROOT 547 | iphoneos 548 | 549 | isa 550 | XCBuildConfiguration 551 | name 552 | Debug 553 | 554 | 63A13F3A169631EF007BB27E 555 | 556 | buildSettings 557 | 558 | ALWAYS_SEARCH_USER_PATHS 559 | NO 560 | CLANG_CXX_LANGUAGE_STANDARD 561 | gnu++0x 562 | CLANG_CXX_LIBRARY 563 | libc++ 564 | CLANG_ENABLE_OBJC_ARC 565 | YES 566 | CLANG_WARN_EMPTY_BODY 567 | YES 568 | CLANG_WARN__DUPLICATE_METHOD_MATCH 569 | YES 570 | CODE_SIGN_IDENTITY[sdk=iphoneos*] 571 | iPhone Developer 572 | COPY_PHASE_STRIP 573 | YES 574 | GCC_C_LANGUAGE_STANDARD 575 | gnu99 576 | GCC_WARN_ABOUT_RETURN_TYPE 577 | YES 578 | GCC_WARN_UNINITIALIZED_AUTOS 579 | YES 580 | GCC_WARN_UNUSED_VARIABLE 581 | YES 582 | IPHONEOS_DEPLOYMENT_TARGET 583 | 6.0 584 | OTHER_CFLAGS 585 | -DNS_BLOCK_ASSERTIONS=1 586 | SDKROOT 587 | iphoneos 588 | VALIDATE_PRODUCT 589 | YES 590 | 591 | isa 592 | XCBuildConfiguration 593 | name 594 | Release 595 | 596 | 63A13F3B169631EF007BB27E 597 | 598 | buildConfigurations 599 | 600 | 63A13F3C169631EF007BB27E 601 | 63A13F3D169631EF007BB27E 602 | 603 | defaultConfigurationIsVisible 604 | 0 605 | defaultConfigurationName 606 | Release 607 | isa 608 | XCConfigurationList 609 | 610 | 63A13F3C169631EF007BB27E 611 | 612 | baseConfigurationReference 613 | BFEF32E1652B7E92E25939CE 614 | buildSettings 615 | 616 | FRAMEWORK_SEARCH_PATHS 617 | 618 | $(inherited) 619 | "$(SRCROOT)" 620 | 621 | GCC_PRECOMPILE_PREFIX_HEADER 622 | YES 623 | GCC_PREFIX_HEADER 624 | MailcheckDemo/MailcheckDemo-Prefix.pch 625 | INFOPLIST_FILE 626 | MailcheckDemo/MailcheckDemo-Info.plist 627 | IPHONEOS_DEPLOYMENT_TARGET 628 | 6.0 629 | PRODUCT_NAME 630 | $(TARGET_NAME) 631 | WRAPPER_EXTENSION 632 | app 633 | 634 | isa 635 | XCBuildConfiguration 636 | name 637 | Debug 638 | 639 | 63A13F3D169631EF007BB27E 640 | 641 | baseConfigurationReference 642 | 650D90134B53CD8D179BCC84 643 | buildSettings 644 | 645 | FRAMEWORK_SEARCH_PATHS 646 | 647 | $(inherited) 648 | "$(SRCROOT)" 649 | 650 | GCC_PRECOMPILE_PREFIX_HEADER 651 | YES 652 | GCC_PREFIX_HEADER 653 | MailcheckDemo/MailcheckDemo-Prefix.pch 654 | INFOPLIST_FILE 655 | MailcheckDemo/MailcheckDemo-Info.plist 656 | IPHONEOS_DEPLOYMENT_TARGET 657 | 6.0 658 | PRODUCT_NAME 659 | $(TARGET_NAME) 660 | WRAPPER_EXTENSION 661 | app 662 | 663 | isa 664 | XCBuildConfiguration 665 | name 666 | Release 667 | 668 | 63A13F3E16963253007BB27E 669 | 670 | buildActionMask 671 | 2147483647 672 | files 673 | 674 | 63A13F4E16963253007BB27E 675 | 63A13F601696357E007BB27E 676 | 677 | isa 678 | PBXSourcesBuildPhase 679 | runOnlyForDeploymentPostprocessing 680 | 0 681 | 682 | 63A13F3F16963253007BB27E 683 | 684 | buildActionMask 685 | 2147483647 686 | files 687 | 688 | 63B79CCF169640D6009EBA25 689 | 63A13F4416963253007BB27E 690 | 63A13F4516963253007BB27E 691 | 63A13F4616963253007BB27E 692 | 63A13F5E16963324007BB27E 693 | 694 | isa 695 | PBXFrameworksBuildPhase 696 | runOnlyForDeploymentPostprocessing 697 | 0 698 | 699 | 63A13F4016963253007BB27E 700 | 701 | buildActionMask 702 | 2147483647 703 | files 704 | 705 | 63A13F4C16963253007BB27E 706 | 63A13F5416963253007BB27E 707 | 63A13F5616963253007BB27E 708 | 63A13F5816963253007BB27E 709 | 710 | isa 711 | PBXResourcesBuildPhase 712 | runOnlyForDeploymentPostprocessing 713 | 0 714 | 715 | 63A13F4116963253007BB27E 716 | 717 | buildConfigurationList 718 | 63A13F5916963253007BB27E 719 | buildPhases 720 | 721 | 63A13F3E16963253007BB27E 722 | 63A13F3F16963253007BB27E 723 | 63A13F4016963253007BB27E 724 | 725 | buildRules 726 | 727 | dependencies 728 | 729 | isa 730 | PBXNativeTarget 731 | name 732 | Tests 733 | productName 734 | Tests 735 | productReference 736 | 63A13F4216963253007BB27E 737 | productType 738 | com.apple.product-type.application 739 | 740 | 63A13F4216963253007BB27E 741 | 742 | explicitFileType 743 | wrapper.application 744 | includeInIndex 745 | 0 746 | isa 747 | PBXFileReference 748 | path 749 | Tests.app 750 | sourceTree 751 | BUILT_PRODUCTS_DIR 752 | 753 | 63A13F4416963253007BB27E 754 | 755 | fileRef 756 | 63A13F21169631EE007BB27E 757 | isa 758 | PBXBuildFile 759 | 760 | 63A13F4516963253007BB27E 761 | 762 | fileRef 763 | 63A13F23169631EE007BB27E 764 | isa 765 | PBXBuildFile 766 | 767 | 63A13F4616963253007BB27E 768 | 769 | fileRef 770 | 63A13F25169631EE007BB27E 771 | isa 772 | PBXBuildFile 773 | 774 | 63A13F4716963253007BB27E 775 | 776 | children 777 | 778 | 63A13F5F1696357E007BB27E 779 | 63A13F4816963253007BB27E 780 | 781 | isa 782 | PBXGroup 783 | path 784 | Tests 785 | sourceTree 786 | <group> 787 | 788 | 63A13F4816963253007BB27E 789 | 790 | children 791 | 792 | 63A13F4916963253007BB27E 793 | 63A13F4A16963253007BB27E 794 | 63A13F4D16963253007BB27E 795 | 63A13F4F16963253007BB27E 796 | 63A13F5316963253007BB27E 797 | 63A13F5516963253007BB27E 798 | 63A13F5716963253007BB27E 799 | 800 | isa 801 | PBXGroup 802 | name 803 | Supporting Files 804 | sourceTree 805 | <group> 806 | 807 | 63A13F4916963253007BB27E 808 | 809 | isa 810 | PBXFileReference 811 | lastKnownFileType 812 | text.plist.xml 813 | path 814 | Tests-Info.plist 815 | sourceTree 816 | <group> 817 | 818 | 63A13F4A16963253007BB27E 819 | 820 | children 821 | 822 | 63A13F4B16963253007BB27E 823 | 824 | isa 825 | PBXVariantGroup 826 | name 827 | InfoPlist.strings 828 | sourceTree 829 | <group> 830 | 831 | 63A13F4B16963253007BB27E 832 | 833 | isa 834 | PBXFileReference 835 | lastKnownFileType 836 | text.plist.strings 837 | name 838 | en 839 | path 840 | en.lproj/InfoPlist.strings 841 | sourceTree 842 | <group> 843 | 844 | 63A13F4C16963253007BB27E 845 | 846 | fileRef 847 | 63A13F4A16963253007BB27E 848 | isa 849 | PBXBuildFile 850 | 851 | 63A13F4D16963253007BB27E 852 | 853 | isa 854 | PBXFileReference 855 | lastKnownFileType 856 | sourcecode.c.objc 857 | path 858 | main.m 859 | sourceTree 860 | <group> 861 | 862 | 63A13F4E16963253007BB27E 863 | 864 | fileRef 865 | 63A13F4D16963253007BB27E 866 | isa 867 | PBXBuildFile 868 | 869 | 63A13F4F16963253007BB27E 870 | 871 | isa 872 | PBXFileReference 873 | lastKnownFileType 874 | sourcecode.c.h 875 | path 876 | Tests-Prefix.pch 877 | sourceTree 878 | <group> 879 | 880 | 63A13F5316963253007BB27E 881 | 882 | isa 883 | PBXFileReference 884 | lastKnownFileType 885 | image.png 886 | path 887 | Default.png 888 | sourceTree 889 | <group> 890 | 891 | 63A13F5416963253007BB27E 892 | 893 | fileRef 894 | 63A13F5316963253007BB27E 895 | isa 896 | PBXBuildFile 897 | 898 | 63A13F5516963253007BB27E 899 | 900 | isa 901 | PBXFileReference 902 | lastKnownFileType 903 | image.png 904 | path 905 | Default@2x.png 906 | sourceTree 907 | <group> 908 | 909 | 63A13F5616963253007BB27E 910 | 911 | fileRef 912 | 63A13F5516963253007BB27E 913 | isa 914 | PBXBuildFile 915 | 916 | 63A13F5716963253007BB27E 917 | 918 | isa 919 | PBXFileReference 920 | lastKnownFileType 921 | image.png 922 | path 923 | Default-568h@2x.png 924 | sourceTree 925 | <group> 926 | 927 | 63A13F5816963253007BB27E 928 | 929 | fileRef 930 | 63A13F5716963253007BB27E 931 | isa 932 | PBXBuildFile 933 | 934 | 63A13F5916963253007BB27E 935 | 936 | buildConfigurations 937 | 938 | 63A13F5A16963253007BB27E 939 | 63A13F5B16963253007BB27E 940 | 941 | defaultConfigurationIsVisible 942 | 0 943 | defaultConfigurationName 944 | Release 945 | isa 946 | XCConfigurationList 947 | 948 | 63A13F5A16963253007BB27E 949 | 950 | buildSettings 951 | 952 | CODE_SIGN_IDENTITY[sdk=iphoneos*] 953 | iPhone Developer 954 | FRAMEWORK_SEARCH_PATHS 955 | 956 | $(inherited) 957 | "$(SRCROOT)" 958 | 959 | GCC_PRECOMPILE_PREFIX_HEADER 960 | YES 961 | GCC_PREFIX_HEADER 962 | Tests/Tests-Prefix.pch 963 | INFOPLIST_FILE 964 | Tests/Tests-Info.plist 965 | OTHER_LDFLAGS 966 | 967 | -ObjC 968 | -all_load 969 | 970 | PRODUCT_NAME 971 | $(TARGET_NAME) 972 | WRAPPER_EXTENSION 973 | app 974 | 975 | isa 976 | XCBuildConfiguration 977 | name 978 | Debug 979 | 980 | 63A13F5B16963253007BB27E 981 | 982 | buildSettings 983 | 984 | CODE_SIGN_IDENTITY[sdk=iphoneos*] 985 | iPhone Developer 986 | FRAMEWORK_SEARCH_PATHS 987 | 988 | $(inherited) 989 | "$(SRCROOT)" 990 | 991 | GCC_PRECOMPILE_PREFIX_HEADER 992 | YES 993 | GCC_PREFIX_HEADER 994 | Tests/Tests-Prefix.pch 995 | INFOPLIST_FILE 996 | Tests/Tests-Info.plist 997 | OTHER_LDFLAGS 998 | 999 | -ObjC 1000 | -all_load 1001 | 1002 | PRODUCT_NAME 1003 | $(TARGET_NAME) 1004 | WRAPPER_EXTENSION 1005 | app 1006 | 1007 | isa 1008 | XCBuildConfiguration 1009 | name 1010 | Release 1011 | 1012 | 63A13F5C1696330A007BB27E 1013 | 1014 | isa 1015 | PBXFileReference 1016 | lastKnownFileType 1017 | wrapper.framework 1018 | path 1019 | GHUnitIOS.framework 1020 | sourceTree 1021 | <group> 1022 | 1023 | 63A13F5E16963324007BB27E 1024 | 1025 | fileRef 1026 | 63A13F5C1696330A007BB27E 1027 | isa 1028 | PBXBuildFile 1029 | 1030 | 63A13F5F1696357E007BB27E 1031 | 1032 | fileEncoding 1033 | 4 1034 | isa 1035 | PBXFileReference 1036 | lastKnownFileType 1037 | sourcecode.c.objc 1038 | path 1039 | TestMailcheck.m 1040 | sourceTree 1041 | <group> 1042 | 1043 | 63A13F601696357E007BB27E 1044 | 1045 | fileRef 1046 | 63A13F5F1696357E007BB27E 1047 | isa 1048 | PBXBuildFile 1049 | 1050 | 63B79CCE169640D6009EBA25 1051 | 1052 | isa 1053 | PBXFileReference 1054 | lastKnownFileType 1055 | wrapper.framework 1056 | name 1057 | QuartzCore.framework 1058 | path 1059 | System/Library/Frameworks/QuartzCore.framework 1060 | sourceTree 1061 | SDKROOT 1062 | 1063 | 63B79CCF169640D6009EBA25 1064 | 1065 | fileRef 1066 | 63B79CCE169640D6009EBA25 1067 | isa 1068 | PBXBuildFile 1069 | 1070 | 650D90134B53CD8D179BCC84 1071 | 1072 | includeInIndex 1073 | 1 1074 | isa 1075 | PBXFileReference 1076 | lastKnownFileType 1077 | text.xcconfig 1078 | name 1079 | Pods.release.xcconfig 1080 | path 1081 | Pods/Target Support Files/Pods/Pods.release.xcconfig 1082 | sourceTree 1083 | <group> 1084 | 1085 | 74459E94E2ED460EB0F22F61 1086 | 1087 | explicitFileType 1088 | archive.ar 1089 | includeInIndex 1090 | 0 1091 | isa 1092 | PBXFileReference 1093 | path 1094 | libPods.a 1095 | sourceTree 1096 | BUILT_PRODUCTS_DIR 1097 | 1098 | BFEF32E1652B7E92E25939CE 1099 | 1100 | includeInIndex 1101 | 1 1102 | isa 1103 | PBXFileReference 1104 | lastKnownFileType 1105 | text.xcconfig 1106 | name 1107 | Pods.debug.xcconfig 1108 | path 1109 | Pods/Target Support Files/Pods/Pods.debug.xcconfig 1110 | sourceTree 1111 | <group> 1112 | 1113 | F772D5BA18A6B76900FDC6BA 1114 | 1115 | fileEncoding 1116 | 4 1117 | isa 1118 | PBXFileReference 1119 | lastKnownFileType 1120 | sourcecode.c.objc 1121 | name 1122 | Mailcheck.m 1123 | path 1124 | ../../Mailcheck/Mailcheck.m 1125 | sourceTree 1126 | <group> 1127 | 1128 | F772D5BB18A6B76900FDC6BA 1129 | 1130 | fileEncoding 1131 | 4 1132 | isa 1133 | PBXFileReference 1134 | lastKnownFileType 1135 | sourcecode.c.h 1136 | name 1137 | Mailcheck.h 1138 | path 1139 | ../../Mailcheck/Mailcheck.h 1140 | sourceTree 1141 | <group> 1142 | 1143 | F772D5BC18A6B76900FDC6BA 1144 | 1145 | fileRef 1146 | F772D5BA18A6B76900FDC6BA 1147 | isa 1148 | PBXBuildFile 1149 | 1150 | FE56F2B2FE34434295E48B3B 1151 | 1152 | buildActionMask 1153 | 2147483647 1154 | files 1155 | 1156 | inputPaths 1157 | 1158 | isa 1159 | PBXShellScriptBuildPhase 1160 | name 1161 | Copy Pods Resources 1162 | outputPaths 1163 | 1164 | runOnlyForDeploymentPostprocessing 1165 | 0 1166 | shellPath 1167 | /bin/sh 1168 | shellScript 1169 | "${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh" 1170 | 1171 | showEnvVarsInLog 1172 | 0 1173 | 1174 | 1175 | rootObject 1176 | 63A13F14169631EE007BB27E 1177 | 1178 | 1179 | -------------------------------------------------------------------------------- /MailcheckDemo/MailcheckDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MailcheckDemo/MailcheckDemo.xcodeproj/xcuserdata/David.xcuserdatad/xcschemes/MailcheckDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /MailcheckDemo/MailcheckDemo.xcodeproj/xcuserdata/David.xcuserdatad/xcschemes/Tests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /MailcheckDemo/MailcheckDemo.xcodeproj/xcuserdata/David.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | MailcheckDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | Tests.xcscheme 13 | 14 | orderHint 15 | 1 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 63A13F1C169631EE007BB27E 21 | 22 | primary 23 | 24 | 25 | 63A13F4116963253007BB27E 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /MailcheckDemo/MailcheckDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // MailcheckDemo 4 | // 5 | // Created by David Kasper on 1/3/13. 6 | // Copyright (c) 2013 David Kasper. All rights reserved. 7 | // Licensed under the MIT License. 8 | // 9 | 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (strong, nonatomic) UIWindow *window; 15 | @property (strong, nonatomic) UITextField *textField; 16 | @property (strong, nonatomic) UIButton *checkButton; 17 | @property (strong, nonatomic) UILabel *resultLabel; 18 | @property (strong, nonatomic) UILabel *thresholdLabel; 19 | @property (strong, nonatomic) UIStepper *thresholdStepper; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /MailcheckDemo/MailcheckDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // MailcheckDemo 4 | // 5 | // Created by David Kasper on 1/3/13. 6 | // Copyright (c) 2013 David Kasper. All rights reserved. 7 | // Licensed under the MIT License. 8 | // 9 | 10 | #import "AppDelegate.h" 11 | #import "Mailcheck.h" 12 | 13 | @implementation AppDelegate 14 | 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 16 | { 17 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 18 | // Override point for customization after application launch. 19 | self.window.backgroundColor = [UIColor whiteColor]; 20 | 21 | self.textField = [[UITextField alloc] initWithFrame:CGRectMake(20, 30, 280, 20)]; 22 | self.textField.placeholder = @"test@example.com"; 23 | [self.window addSubview:self.textField]; 24 | 25 | self.thresholdLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, CGRectGetMaxY(self.textField.frame) + 15, 200, 20)]; 26 | self.thresholdStepper = [[UIStepper alloc] initWithFrame:CGRectMake(220, CGRectGetMaxY(self.textField.frame) + 10, 94, 20)]; 27 | self.thresholdStepper.value = 3; 28 | [self.thresholdStepper addTarget:self action:@selector(step:) forControlEvents:UIControlEventValueChanged]; 29 | self.thresholdLabel.text = [NSString stringWithFormat:@"Threshold: %d", (int)self.thresholdStepper.value]; 30 | [self.window addSubview:self.thresholdLabel]; 31 | [self.window addSubview:self.thresholdStepper]; 32 | 33 | self.checkButton = [UIButton buttonWithType:UIButtonTypeSystem]; 34 | [self.checkButton setTitle:@"Check" forState:UIControlStateNormal]; 35 | [self.checkButton addTarget:self action:@selector(check:) forControlEvents:UIControlEventTouchUpInside]; 36 | self.checkButton.frame = CGRectMake(20, CGRectGetMaxY(self.thresholdStepper.frame) + 10, 280, 40); 37 | [self.window addSubview:self.checkButton]; 38 | 39 | self.resultLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, CGRectGetMaxY(self.checkButton.frame) + 10, 280, 60)]; 40 | self.resultLabel.numberOfLines = 3; 41 | [self.window addSubview:self.resultLabel]; 42 | 43 | [self.window makeKeyAndVisible]; 44 | return YES; 45 | } 46 | 47 | - (void)step:(id)sender { 48 | [Mailcheck setThreshold:self.thresholdStepper.value]; 49 | self.thresholdLabel.text = [NSString stringWithFormat:@"Threshold: %d", (int)self.thresholdStepper.value]; 50 | } 51 | 52 | -(void)check:(id)sender { 53 | NSDictionary *result = [Mailcheck check:self.textField.text extraDomains:nil extraTopLevelDomains:nil]; 54 | if (result[@"suggestion"]) { 55 | self.resultLabel.text = [NSString stringWithFormat:@"Did you mean %@?.\nValid: %d", result[@"suggestion"][@"full"], [result[@"valid"] boolValue]]; 56 | } else { 57 | self.resultLabel.text = [NSString stringWithFormat:@"No suggestion found.\nValid email: %d", [result[@"valid"] boolValue]]; 58 | } 59 | } 60 | 61 | - (void)applicationWillResignActive:(UIApplication *)application 62 | { 63 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 64 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 65 | } 66 | 67 | - (void)applicationDidEnterBackground:(UIApplication *)application 68 | { 69 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 70 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 71 | } 72 | 73 | - (void)applicationWillEnterForeground:(UIApplication *)application 74 | { 75 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 76 | } 77 | 78 | - (void)applicationDidBecomeActive:(UIApplication *)application 79 | { 80 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 81 | } 82 | 83 | - (void)applicationWillTerminate:(UIApplication *)application 84 | { 85 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 86 | } 87 | 88 | @end 89 | -------------------------------------------------------------------------------- /MailcheckDemo/MailcheckDemo/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mailcheck/mailcheck-objectivec/48e0fbd049f2c208efada90cd824d1344d4e6d49/MailcheckDemo/MailcheckDemo/Default-568h@2x.png -------------------------------------------------------------------------------- /MailcheckDemo/MailcheckDemo/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mailcheck/mailcheck-objectivec/48e0fbd049f2c208efada90cd824d1344d4e6d49/MailcheckDemo/MailcheckDemo/Default.png -------------------------------------------------------------------------------- /MailcheckDemo/MailcheckDemo/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mailcheck/mailcheck-objectivec/48e0fbd049f2c208efada90cd824d1344d4e6d49/MailcheckDemo/MailcheckDemo/Default@2x.png -------------------------------------------------------------------------------- /MailcheckDemo/MailcheckDemo/MailcheckDemo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.mixbook.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /MailcheckDemo/MailcheckDemo/MailcheckDemo-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'MailcheckDemo' target in the 'MailcheckDemo' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iOS SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /MailcheckDemo/MailcheckDemo/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /MailcheckDemo/MailcheckDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // MailcheckDemo 4 | // 5 | // Created by David Kasper on 1/3/13. 6 | // Copyright (c) 2013 David Kasper. All rights reserved. 7 | // Licensed under the MIT License. 8 | // 9 | 10 | #import 11 | 12 | #import "AppDelegate.h" 13 | 14 | int main(int argc, char *argv[]) 15 | { 16 | @autoreleasepool { 17 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /MailcheckDemo/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git 2 | platform :ios, '6.0' 3 | pod 'NSString-Email' 4 | -------------------------------------------------------------------------------- /MailcheckDemo/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - NSString-Email (0.0.2) 3 | 4 | DEPENDENCIES: 5 | - NSString-Email 6 | 7 | SPEC CHECKSUMS: 8 | NSString-Email: 5bd2c7e59fb9705f75aeae541882b8d47a212f2e 9 | 10 | COCOAPODS: 0.34.4 11 | -------------------------------------------------------------------------------- /MailcheckDemo/Tests/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mailcheck/mailcheck-objectivec/48e0fbd049f2c208efada90cd824d1344d4e6d49/MailcheckDemo/Tests/Default-568h@2x.png -------------------------------------------------------------------------------- /MailcheckDemo/Tests/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mailcheck/mailcheck-objectivec/48e0fbd049f2c208efada90cd824d1344d4e6d49/MailcheckDemo/Tests/Default.png -------------------------------------------------------------------------------- /MailcheckDemo/Tests/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mailcheck/mailcheck-objectivec/48e0fbd049f2c208efada90cd824d1344d4e6d49/MailcheckDemo/Tests/Default@2x.png -------------------------------------------------------------------------------- /MailcheckDemo/Tests/TestMailcheck.m: -------------------------------------------------------------------------------- 1 | // 2 | // TestMailcheck.m 3 | // Frost 4 | // 5 | // Created by David Kasper on 1/3/13. 6 | // Copyright (c) 2013 Mixbook. All rights reserved. 7 | // Licensed under the MIT License. 8 | // 9 | 10 | #import 11 | #import "Mailcheck.h" 12 | 13 | @interface MailcheckTester : Mailcheck 14 | +(NSString *)findClosestDomain:(NSString *)domain domains:(NSArray *)domains; 15 | +(NSDictionary *)splitEmail:(NSString *)email; 16 | @end 17 | 18 | @implementation MailcheckTester 19 | 20 | @end 21 | 22 | @interface TestMailcheck : GHTestCase { } 23 | @end 24 | 25 | @implementation TestMailcheck 26 | 27 | - (void)testValid { 28 | NSDictionary *result = [Mailcheck suggest:@"david@hotmail.com"]; 29 | GHAssertNil(result, @"nil for valid domain"); 30 | } 31 | 32 | - (void)testSplitEmail { 33 | GHAssertEqualObjects([MailcheckTester splitEmail:@"test@example.com"], (@{@"address" : @"test", @"domain": @"example.com", @"topLevelDomain": @"com"}), @"basic"); 34 | GHAssertEqualObjects([MailcheckTester splitEmail:@"test@example.co.uk"], (@{@"address" : @"test", @"domain": @"example.co.uk", @"topLevelDomain": @"co.uk"}), @"co.uk"); 35 | GHAssertEqualObjects([MailcheckTester splitEmail:@"test@mail.randomsmallcompany.co.uk"], (@{@"address" : @"test", @"domain": @"mail.randomsmallcompany.co.uk", @"topLevelDomain": @"randomsmallcompany.co.uk"}), @"randomsmallcompany"); 36 | GHAssertEqualObjects([MailcheckTester splitEmail:@"\"foo@bar\"@example.com"], (@{@"address" : @"\"foo@bar\"", @"domain": @"example.com", @"topLevelDomain": @"com"}), @"foobar"); 37 | GHAssertEqualObjects([MailcheckTester splitEmail:@"containsnumbers1234567890@example.com"], (@{@"address" : @"containsnumbers1234567890", @"domain": @"example.com", @"topLevelDomain": @"com"}), @"basic"); 38 | GHAssertEqualObjects([MailcheckTester splitEmail:@"contains+symbol@example.com"], (@{@"address" : @"contains+symbol", @"domain": @"example.com", @"topLevelDomain": @"com"}), @"+ symbol"); 39 | GHAssertEqualObjects([MailcheckTester splitEmail:@"contains-symbol@example.com"], (@{@"address" : @"contains-symbol", @"domain": @"example.com", @"topLevelDomain": @"com"}), @"- symbol"); 40 | GHAssertEqualObjects([MailcheckTester splitEmail:@"contains.symbol@example.com"], (@{@"address" : @"contains.symbol", @"domain": @"example.com", @"topLevelDomain": @"com"}), @". symbol"); 41 | GHAssertEqualObjects([MailcheckTester splitEmail:@"\"contains.and\\ symbols\"@example.com"], (@{@"address" : @"\"contains.and\\ symbols\"", @"domain": @"example.com", @"topLevelDomain": @"com"}), @". and \\ symbols"); 42 | GHAssertEqualObjects([MailcheckTester splitEmail:@"\"contains.and.@.symbols.com\"@example.com"], (@{@"address" : @"\"contains.and.@.symbols.com\"", @"domain": @"example.com", @"topLevelDomain": @"com"}), @"@ and \\ symbols"); 43 | GHAssertEqualObjects([MailcheckTester splitEmail:@"\"()<>[]:;@,\\\"!#$%&\'*+-/=?^_`{}|^_`{}|~.a\"@allthesymbols.com"], (@{@"address" : @"\"()<>[]:;@,\\\"!#$%&\'*+-/=?^_`{}|^_`{}|~.a\"", @"domain": @"allthesymbols.com", @"topLevelDomain": @"com"}), @"all the symbols"); 44 | GHAssertEqualObjects([MailcheckTester splitEmail:@"postbox@com"], (@{@"address" : @"postbox", @"domain": @"com", @"topLevelDomain": @"com"}), @"basic"); 45 | } 46 | 47 | - (void)testInvalidEmail { 48 | GHAssertNil([Mailcheck suggest:@"david@"], @"no domain"); 49 | GHAssertNil([Mailcheck suggest:@"@hotmail.com"], @"no address"); 50 | GHAssertNil([Mailcheck suggest:@"example.com"], @"domain only"); 51 | GHAssertNil([Mailcheck suggest:@"abc.example.com"], @"subdomain only"); 52 | GHAssertNil([MailcheckTester splitEmail:@"david@"], @"no domain"); 53 | GHAssertNil([MailcheckTester splitEmail:@"@hotmail.com"], @"no address"); 54 | GHAssertNil([MailcheckTester splitEmail:@"example.com"], @"domain only"); 55 | GHAssertNil([MailcheckTester splitEmail:@"abc.example.com"], @"subdomain only"); 56 | } 57 | 58 | - (void)testFindClosestDomain { 59 | NSArray *defaultDomains = @[@"yahoo.com", @"google.com", @"hotmail.com", @"gmail.com", @"me.com", @"aol.com", @"mac.com", @"live.com", @"comcast.net", @"googlemail.com", @"msn.com", @"hotmail.co.uk", @"yahoo.co.uk", @"facebook.com", @"verizon.net", @"sbcglobal.net", @"att.net", @"gmx.com", @"mail.com", @"yahoo.com.tw"]; 60 | 61 | GHAssertEqualStrings([MailcheckTester findClosestDomain:@"yahoo.com.tw" domains:defaultDomains], @"yahoo.com.tw", @"yahoo"); 62 | GHAssertEqualStrings([MailcheckTester findClosestDomain:@"hotmail.com" domains:defaultDomains], @"hotmail.com", @"hotmail"); 63 | GHAssertEqualStrings([MailcheckTester findClosestDomain:@"gms.com" domains:defaultDomains], @"gmx.com", @"gmx"); 64 | GHAssertEqualStrings([MailcheckTester findClosestDomain:@"gmsn.com" domains:defaultDomains], @"msn.com", @"msn"); 65 | GHAssertEqualStrings([MailcheckTester findClosestDomain:@"gmaik.com" domains:defaultDomains], @"gmail.com", @"gmail"); 66 | } 67 | 68 | - (void)testFindClosestTLD { 69 | NSArray *topLevelDomains = @[@"co.uk", @"com", @"net", @"org", @"info", @"edu", @"gov", @"mil", @"com.tw"]; 70 | GHAssertEqualStrings([MailcheckTester findClosestDomain:@"cmo" domains:topLevelDomains], @"com", @"com"); 71 | GHAssertEqualStrings([MailcheckTester findClosestDomain:@"ogr" domains:topLevelDomains], @"org", @"org"); 72 | GHAssertEqualStrings([MailcheckTester findClosestDomain:@"ifno" domains:topLevelDomains], @"info", @"info"); 73 | GHAssertEqualStrings([MailcheckTester findClosestDomain:@"com.uk" domains:topLevelDomains], @"co.uk", @"co.uk"); 74 | } 75 | 76 | - (void)testMistypedDomain { 77 | NSArray *defaultDomains = @[@"yahoo.com", @"google.com", @"hotmail.com", @"gmail.com", @"me.com", @"aol.com", @"mac.com", @"live.com", @"comcast.net", @"googlemail.com", @"msn.com", @"hotmail.co.uk", @"yahoo.co.uk", @"facebook.com", @"verizon.net", @"sbcglobal.net", @"att.net", @"gmx.com", @"mail.com", @"yahoo.com.tw"]; 78 | NSArray *defaultTopLevelDomains = @[@"co.uk", @"com", @"net", @"org", @"info", @"edu", @"gov", @"mil", @"com.tw"]; 79 | 80 | GHAssertEqualStrings([Mailcheck suggest:@"test@emaildomain.co" domains:defaultDomains topLevelDomains:defaultTopLevelDomains][@"domain"], @"emaildomain.com", @"email domain"); 81 | GHAssertEqualStrings([Mailcheck suggest:@"test@gmail.con" domains:defaultDomains topLevelDomains:defaultTopLevelDomains][@"domain"], @"gmail.com", @"gmail.con"); 82 | GHAssertEqualStrings([Mailcheck suggest:@"test@gnail.con" domains:defaultDomains topLevelDomains:defaultTopLevelDomains][@"domain"], @"gmail.com", @"gnail"); 83 | GHAssertEqualStrings([Mailcheck suggest:@"test@GNAIL.con" domains:defaultDomains topLevelDomains:defaultTopLevelDomains][@"domain"], @"gmail.com", @"GNAIL"); 84 | GHAssertEqualStrings([Mailcheck suggest:@"test@#gmail.com" domains:defaultDomains topLevelDomains:defaultTopLevelDomains][@"domain"], @"gmail.com", @"#gmail"); 85 | GHAssertEqualStrings([Mailcheck suggest:@"test@comcast.com" domains:defaultDomains topLevelDomains:defaultTopLevelDomains][@"domain"], @"comcast.net", @"comcast"); 86 | GHAssertEqualStrings([Mailcheck suggest:@"test@hotmail.con" domains:defaultDomains topLevelDomains:defaultTopLevelDomains][@"domain"], @"hotmail.com", @"hotmail.con"); 87 | GHAssertEqualStrings([Mailcheck suggest:@"test@hotmail.co" domains:defaultDomains topLevelDomains:defaultTopLevelDomains][@"domain"], @"hotmail.com", @"hotmail.co"); 88 | GHAssertEqualStrings([Mailcheck suggest:@"test@fabecook.com" domains:defaultDomains topLevelDomains:defaultTopLevelDomains][@"domain"], @"facebook.com", @"fabecook.com"); 89 | GHAssertEqualStrings([Mailcheck suggest:@"test@yajoo.com" domains:defaultDomains topLevelDomains:defaultTopLevelDomains][@"domain"], @"yahoo.com", @"yahoo.com"); 90 | GHAssertEqualStrings([Mailcheck suggest:@"test@randomsmallcompany.cmo" domains:defaultDomains topLevelDomains:defaultTopLevelDomains][@"domain"], @"randomsmallcompany.com", @"small company"); 91 | GHAssertNil([Mailcheck suggest:@"test@yahoo.com.tw" domains:defaultDomains topLevelDomains:defaultTopLevelDomains], @"valid"); 92 | GHAssertNil([Mailcheck suggest:@"" domains:defaultDomains topLevelDomains:defaultTopLevelDomains], @"valid"); 93 | GHAssertNil([Mailcheck suggest:@"test@" domains:defaultDomains topLevelDomains:defaultTopLevelDomains], @"valid"); 94 | GHAssertNil([Mailcheck suggest:@"test" domains:defaultDomains topLevelDomains:defaultTopLevelDomains], @"valid"); 95 | 96 | /* This test is for illustrative purposes as the splitEmail function should return a better 97 | * representation of the true top-level domain in the case of an email address with subdomains. 98 | * mailcheck will be unable to return a suggestion in the case of this email address. 99 | */ 100 | GHAssertNil([Mailcheck suggest:@"test@mail.randomsmallcompany.cmo" domains:defaultDomains topLevelDomains:defaultTopLevelDomains], @"no suggestion"); 101 | } 102 | 103 | @end 104 | -------------------------------------------------------------------------------- /MailcheckDemo/Tests/Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.mixbook.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /MailcheckDemo/Tests/Tests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Tests' target in the 'Tests' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iOS SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /MailcheckDemo/Tests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /MailcheckDemo/Tests/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Tests 4 | // 5 | // Created by David Kasper on 1/3/13. 6 | // Copyright (c) 2013 David Kasper. All rights reserved. 7 | // Licensed under the MIT License. 8 | // 9 | 10 | #import 11 | 12 | int main(int argc, char *argv[]) 13 | { 14 | @autoreleasepool { 15 | return UIApplicationMain(argc, argv, nil, @"GHUnitIOSAppDelegate"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Mailcheck - Objective-C 2 | ==================== 3 | 4 | The Objective-C library that suggests a right domain when your users misspell it in an email address. See the original at https://github.com/mailcheck/mailcheck. 5 | 6 | When your user types in "user@hotnail.con", Mailcheck will suggest "user@hotmail.com". 7 | 8 | Mailcheck will offer up suggestions for top level domains too, and suggest ".com" when a user types in "user@hotmail.cmo". 9 | 10 | mailcheck-objectivec is part of the [Mailcheck family](http://getmailcheck.org), and we're always on the lookout for more ports and adaptions. Get in touch! 11 | 12 | Usage 13 | ----- 14 | 15 | Copy mailcheck.h and mailcheck.m from the Mailcheck folder to your project. 16 | 17 | ```Objective-C 18 | #import "Mailcheck.h" 19 | NSDictionary *result = [Mailcheck suggest:@"test@hotnail.com"] 20 | ``` 21 | 22 | Result will contain nil if the domain appears to be valid. 23 | Otherwise the suggestion will be a dictionary like this: 24 | ```Objective-C 25 | {@"address": @"test", 26 | @"domain": @"hotmail.com", 27 | @"full": @"test@hotmail.com"} 28 | ``` 29 | 30 | New in 0.3 31 | ---------- 32 | 33 | Customize the maximum edit distance. For instance with a threshold of 2: 34 | 35 | ```Objective-C 36 | [Mailcheck setThreshold:2] 37 | [Mailcheck check:@"dkasper@gmailll.com"] 38 | ```` 39 | 40 | will return a suggestion of "dkasper@gmail.com". With a threshold of 1 no suggestion would be returned for this case. The default value is 3. 41 | 42 | New in 0.2 43 | ---------- 44 | 45 | Now includes a check if the email is valid thanks to https://github.com/NZN/NSString-Email 46 | 47 | ```Objective-C 48 | #import "Mailcheck.h" 49 | NSDictionary *result = [Mailcheck check:@"test@hotnail.com"] 50 | ``` 51 | 52 | Result will contain keys for "valid" and "suggestion" 53 | ```Objective-C 54 | {@"valid": @(YES), 55 | @"suggestion": {@"address": @"test", 56 | @"domain": @"hotmail.com", 57 | @"full": @"test@hotmail.com"}} 58 | ``` 59 | 60 | Supply your own domain lists: 61 | ```Objective-C 62 | NSDictionary *result = [Mailcheck check:@"test@mydomain.co" domains:@[@"mydomain.co"] topLevelDomains:@[@"co"]]; 63 | ``` 64 | 65 | Or add to the default list: 66 | ```Objective-C 67 | NSDictionary *result = [Mailcheck check:@"test@mydomain.co" extraDomains:@[@"mydomain.co"] extraTopLevelDomains:@[@"co"]]; 68 | ``` 69 | 70 | Check the MailcheckDemo or the GHUnit tests in TestMailcheck.m for more usage examples. You can run the tests by loading the demo project and selecting the Tests scheme. 71 | 72 | Maintainers 73 | ------- 74 | 75 | - David Kasper, [@dkasper](http://twitter.com/dkasper). Author. 76 | 77 | License 78 | ------- 79 | 80 | Licensed under the MIT License. 81 | -------------------------------------------------------------------------------- /Tests/TestMailcheck.m: -------------------------------------------------------------------------------- 1 | // 2 | // TestMailcheck.m 3 | // Frost 4 | // 5 | // Created by David Kasper on 1/3/13. 6 | // Copyright (c) 2013 Mixbook. All rights reserved. 7 | // Licensed under the MIT License. 8 | // 9 | 10 | #import 11 | #import "Mailcheck.h" 12 | 13 | @interface MailcheckTester : Mailcheck 14 | +(NSString *)findClosestDomain:(NSString *)domain domains:(NSArray *)domains; 15 | +(NSDictionary *)splitEmail:(NSString *)email; 16 | @end 17 | 18 | @implementation MailcheckTester 19 | 20 | @end 21 | 22 | @interface TestMailcheck : GHTestCase { } 23 | @end 24 | 25 | @implementation TestMailcheck 26 | 27 | - (void)testValid { 28 | NSDictionary *result = [Mailcheck suggest:@"david@hotmail.com"]; 29 | GHAssertNil(result, @"nil for valid domain"); 30 | } 31 | 32 | - (void)testSplitEmail { 33 | GHAssertEqualObjects([MailcheckTester splitEmail:@"test@example.com"], (@{@"address" : @"test", @"domain": @"example.com", @"topLevelDomain": @"com"}), @"basic"); 34 | GHAssertEqualObjects([MailcheckTester splitEmail:@"test@example.co.uk"], (@{@"address" : @"test", @"domain": @"example.co.uk", @"topLevelDomain": @"co.uk"}), @"co.uk"); 35 | GHAssertEqualObjects([MailcheckTester splitEmail:@"test@mail.randomsmallcompany.co.uk"], (@{@"address" : @"test", @"domain": @"mail.randomsmallcompany.co.uk", @"topLevelDomain": @"randomsmallcompany.co.uk"}), @"randomsmallcompany"); 36 | GHAssertEqualObjects([MailcheckTester splitEmail:@"\"foo@bar\"@example.com"], (@{@"address" : @"\"foo@bar\"", @"domain": @"example.com", @"topLevelDomain": @"com"}), @"foobar"); 37 | GHAssertEqualObjects([MailcheckTester splitEmail:@"containsnumbers1234567890@example.com"], (@{@"address" : @"containsnumbers1234567890", @"domain": @"example.com", @"topLevelDomain": @"com"}), @"basic"); 38 | GHAssertEqualObjects([MailcheckTester splitEmail:@"contains+symbol@example.com"], (@{@"address" : @"contains+symbol", @"domain": @"example.com", @"topLevelDomain": @"com"}), @"+ symbol"); 39 | GHAssertEqualObjects([MailcheckTester splitEmail:@"contains-symbol@example.com"], (@{@"address" : @"contains-symbol", @"domain": @"example.com", @"topLevelDomain": @"com"}), @"- symbol"); 40 | GHAssertEqualObjects([MailcheckTester splitEmail:@"contains.symbol@example.com"], (@{@"address" : @"contains.symbol", @"domain": @"example.com", @"topLevelDomain": @"com"}), @". symbol"); 41 | GHAssertEqualObjects([MailcheckTester splitEmail:@"\"contains.and\\ symbols\"@example.com"], (@{@"address" : @"\"contains.and\\ symbols\"", @"domain": @"example.com", @"topLevelDomain": @"com"}), @". and \\ symbols"); 42 | GHAssertEqualObjects([MailcheckTester splitEmail:@"\"contains.and.@.symbols.com\"@example.com"], (@{@"address" : @"\"contains.and.@.symbols.com\"", @"domain": @"example.com", @"topLevelDomain": @"com"}), @"@ and \\ symbols"); 43 | GHAssertEqualObjects([MailcheckTester splitEmail:@"\"()<>[]:;@,\\\"!#$%&\'*+-/=?^_`{}|^_`{}|~.a\"@allthesymbols.com"], (@{@"address" : @"\"()<>[]:;@,\\\"!#$%&\'*+-/=?^_`{}|^_`{}|~.a\"", @"domain": @"allthesymbols.com", @"topLevelDomain": @"com"}), @"all the symbols"); 44 | GHAssertEqualObjects([MailcheckTester splitEmail:@"postbox@com"], (@{@"address" : @"postbox", @"domain": @"com", @"topLevelDomain": @"com"}), @"basic"); 45 | } 46 | 47 | - (void)testInvalidEmail { 48 | GHAssertNil([Mailcheck suggest:@"david@"], @"no domain"); 49 | GHAssertNil([Mailcheck suggest:@"@hotmail.com"], @"no address"); 50 | GHAssertNil([Mailcheck suggest:@"example.com"], @"domain only"); 51 | GHAssertNil([Mailcheck suggest:@"abc.example.com"], @"subdomain only"); 52 | GHAssertNil([MailcheckTester splitEmail:@"david@"], @"no domain"); 53 | GHAssertNil([MailcheckTester splitEmail:@"@hotmail.com"], @"no address"); 54 | GHAssertNil([MailcheckTester splitEmail:@"example.com"], @"domain only"); 55 | GHAssertNil([MailcheckTester splitEmail:@"abc.example.com"], @"subdomain only"); 56 | } 57 | 58 | - (void)testFindClosestDomain { 59 | NSArray *defaultDomains = @[@"yahoo.com", @"google.com", @"hotmail.com", @"gmail.com", @"me.com", @"aol.com", @"mac.com", @"live.com", @"comcast.net", @"googlemail.com", @"msn.com", @"hotmail.co.uk", @"yahoo.co.uk", @"facebook.com", @"verizon.net", @"sbcglobal.net", @"att.net", @"gmx.com", @"mail.com", @"yahoo.com.tw"]; 60 | 61 | GHAssertEqualStrings([MailcheckTester findClosestDomain:@"yahoo.com.tw" domains:defaultDomains], @"yahoo.com.tw", @"yahoo"); 62 | GHAssertEqualStrings([MailcheckTester findClosestDomain:@"hotmail.com" domains:defaultDomains], @"hotmail.com", @"hotmail"); 63 | GHAssertEqualStrings([MailcheckTester findClosestDomain:@"gms.com" domains:defaultDomains], @"gmx.com", @"gmx"); 64 | GHAssertEqualStrings([MailcheckTester findClosestDomain:@"gmsn.com" domains:defaultDomains], @"msn.com", @"msn"); 65 | GHAssertEqualStrings([MailcheckTester findClosestDomain:@"gmaik.com" domains:defaultDomains], @"gmail.com", @"gmail"); 66 | } 67 | 68 | - (void)testFindClosestTLD { 69 | NSArray *topLevelDomains = @[@"co.uk", @"com", @"net", @"org", @"info", @"edu", @"gov", @"mil", @"com.tw"]; 70 | GHAssertEqualStrings([MailcheckTester findClosestDomain:@"cmo" domains:topLevelDomains], @"com", @"com"); 71 | GHAssertEqualStrings([MailcheckTester findClosestDomain:@"ogr" domains:topLevelDomains], @"org", @"org"); 72 | GHAssertEqualStrings([MailcheckTester findClosestDomain:@"ifno" domains:topLevelDomains], @"info", @"info"); 73 | GHAssertEqualStrings([MailcheckTester findClosestDomain:@"com.uk" domains:topLevelDomains], @"co.uk", @"co.uk"); 74 | } 75 | 76 | - (void)testMistypedDomain { 77 | NSArray *defaultDomains = @[@"yahoo.com", @"google.com", @"hotmail.com", @"gmail.com", @"me.com", @"aol.com", @"mac.com", @"live.com", @"comcast.net", @"googlemail.com", @"msn.com", @"hotmail.co.uk", @"yahoo.co.uk", @"facebook.com", @"verizon.net", @"sbcglobal.net", @"att.net", @"gmx.com", @"mail.com", @"yahoo.com.tw"]; 78 | NSArray *defaultTopLevelDomains = @[@"co.uk", @"com", @"net", @"org", @"info", @"edu", @"gov", @"mil", @"com.tw"]; 79 | 80 | GHAssertEqualStrings([Mailcheck suggest:@"test@emaildomain.co" domains:defaultDomains topLevelDomains:defaultTopLevelDomains][@"domain"], @"emaildomain.com", @"email domain"); 81 | GHAssertEqualStrings([Mailcheck suggest:@"test@gmail.con" domains:defaultDomains topLevelDomains:defaultTopLevelDomains][@"domain"], @"gmail.com", @"gmail.con"); 82 | GHAssertEqualStrings([Mailcheck suggest:@"test@gnail.con" domains:defaultDomains topLevelDomains:defaultTopLevelDomains][@"domain"], @"gmail.com", @"gnail"); 83 | GHAssertEqualStrings([Mailcheck suggest:@"test@GNAIL.con" domains:defaultDomains topLevelDomains:defaultTopLevelDomains][@"domain"], @"gmail.com", @"GNAIL"); 84 | GHAssertEqualStrings([Mailcheck suggest:@"test@#gmail.com" domains:defaultDomains topLevelDomains:defaultTopLevelDomains][@"domain"], @"gmail.com", @"#gmail"); 85 | GHAssertEqualStrings([Mailcheck suggest:@"test@comcast.com" domains:defaultDomains topLevelDomains:defaultTopLevelDomains][@"domain"], @"comcast.net", @"comcast"); 86 | GHAssertEqualStrings([Mailcheck suggest:@"test@hotmail.con" domains:defaultDomains topLevelDomains:defaultTopLevelDomains][@"domain"], @"hotmail.com", @"hotmail.con"); 87 | GHAssertEqualStrings([Mailcheck suggest:@"test@hotmail.co" domains:defaultDomains topLevelDomains:defaultTopLevelDomains][@"domain"], @"hotmail.com", @"hotmail.co"); 88 | GHAssertEqualStrings([Mailcheck suggest:@"test@fabecook.com" domains:defaultDomains topLevelDomains:defaultTopLevelDomains][@"domain"], @"facebook.com", @"fabecook.com"); 89 | GHAssertEqualStrings([Mailcheck suggest:@"test@yajoo.com" domains:defaultDomains topLevelDomains:defaultTopLevelDomains][@"domain"], @"yahoo.com", @"yahoo.com"); 90 | GHAssertEqualStrings([Mailcheck suggest:@"test@randomsmallcompany.cmo" domains:defaultDomains topLevelDomains:defaultTopLevelDomains][@"domain"], @"randomsmallcompany.com", @"small company"); 91 | GHAssertNil([Mailcheck suggest:@"test@yahoo.com.tw" domains:defaultDomains topLevelDomains:defaultTopLevelDomains], @"valid"); 92 | GHAssertNil([Mailcheck suggest:@"" domains:defaultDomains topLevelDomains:defaultTopLevelDomains], @"valid"); 93 | GHAssertNil([Mailcheck suggest:@"test@" domains:defaultDomains topLevelDomains:defaultTopLevelDomains], @"valid"); 94 | GHAssertNil([Mailcheck suggest:@"test" domains:defaultDomains topLevelDomains:defaultTopLevelDomains], @"valid"); 95 | 96 | /* This test is for illustrative purposes as the splitEmail function should return a better 97 | * representation of the true top-level domain in the case of an email address with subdomains. 98 | * mailcheck will be unable to return a suggestion in the case of this email address. 99 | */ 100 | GHAssertNil([Mailcheck suggest:@"test@mail.randomsmallcompany.cmo" domains:defaultDomains topLevelDomains:defaultTopLevelDomains], @"no suggestion"); 101 | } 102 | 103 | @end 104 | --------------------------------------------------------------------------------