├── .gitignore ├── File Templates ├── OCUnit Test.xctemplate │ ├── TemplateIcon.icns │ ├── TemplateInfo.plist │ └── ___FILEBASENAME___.m └── Speca Spec.xctemplate │ ├── TemplateIcon.icns │ ├── TemplateInfo.plist │ └── ___FILEBASENAME___.m ├── Project Templates ├── Cocoa Framework with Macruby Tests │ ├── English.lproj │ │ └── InfoPlist.strings │ ├── Info.plist │ ├── Tests │ │ ├── Gemfile │ │ ├── Gemfile.lock │ │ ├── run_suite.rb │ │ ├── sample_spec.rb │ │ └── spec_helper.rb │ ├── ___PROJECTNAME___.xcodeproj │ │ ├── TemplateIcon.icns │ │ ├── TemplateInfo.plist │ │ └── project.pbxproj │ ├── ___PROJECTNAME___Tests-Info.plist │ └── ___PROJECTNAME____Prefix.pch └── IOS Window-Based Application with Unit Tests │ ├── Classes │ ├── ___PROJECTNAMEASIDENTIFIER___AppDelegate.h │ └── ___PROJECTNAMEASIDENTIFIER___AppDelegate.m │ ├── Frameworks │ └── Testing │ │ ├── GHUnitIOS.framework │ │ ├── GHUnitIOS │ │ ├── Headers │ │ ├── Resources │ │ └── Versions │ │ │ ├── A │ │ │ ├── GHUnitIOS │ │ │ ├── Headers │ │ │ │ ├── GHAsyncTestCase.h │ │ │ │ ├── GHTest+JUnitXML.h │ │ │ │ ├── GHTest.h │ │ │ │ ├── GHTestCase.h │ │ │ │ ├── GHTestGroup+JUnitXML.h │ │ │ │ ├── GHTestGroup.h │ │ │ │ ├── GHTestMacros.h │ │ │ │ ├── GHTestOperation.h │ │ │ │ ├── GHTestRunner.h │ │ │ │ ├── GHTestSuite.h │ │ │ │ ├── GHTesting.h │ │ │ │ ├── GHUnit.h │ │ │ │ ├── GHUnitIPhoneAppDelegate.h │ │ │ │ ├── GHUnitIPhoneTableViewDataSource.h │ │ │ │ ├── GHUnitIPhoneTestViewController.h │ │ │ │ ├── GHUnitIPhoneView.h │ │ │ │ ├── GHUnitIPhoneViewController.h │ │ │ │ ├── NSException+GHTestFailureExceptions.h │ │ │ │ └── NSValue+GHValueFormatter.h │ │ │ └── Resources │ │ │ │ └── Info.plist │ │ │ └── Current │ │ ├── GHUnitIOSTestMain.m │ │ ├── OCHamcrestIOS.framework │ │ ├── Headers │ │ ├── OCHamcrestIOS │ │ ├── Resources │ │ └── Versions │ │ │ ├── A │ │ │ ├── Headers │ │ │ │ ├── HCAllOf.h │ │ │ │ ├── HCAnyOf.h │ │ │ │ ├── HCAssertThat.h │ │ │ │ ├── HCBaseDescription.h │ │ │ │ ├── HCBaseMatcher.h │ │ │ │ ├── HCBoxNumber.h │ │ │ │ ├── HCCollectMatchers.h │ │ │ │ ├── HCDescribedAs.h │ │ │ │ ├── HCDescription.h │ │ │ │ ├── HCHasCount.h │ │ │ │ ├── HCHasDescription.h │ │ │ │ ├── HCInvocationMatcher.h │ │ │ │ ├── HCIs.h │ │ │ │ ├── HCIsAnything.h │ │ │ │ ├── HCIsCloseTo.h │ │ │ │ ├── HCIsCollectionContaining.h │ │ │ │ ├── HCIsCollectionContainingInAnyOrder.h │ │ │ │ ├── HCIsCollectionContainingInOrder.h │ │ │ │ ├── HCIsCollectionOnlyContaining.h │ │ │ │ ├── HCIsDictionaryContaining.h │ │ │ │ ├── HCIsDictionaryContainingEntries.h │ │ │ │ ├── HCIsDictionaryContainingKey.h │ │ │ │ ├── HCIsDictionaryContainingValue.h │ │ │ │ ├── HCIsEmptyCollection.h │ │ │ │ ├── HCIsEqual.h │ │ │ │ ├── HCIsEqualIgnoringCase.h │ │ │ │ ├── HCIsEqualIgnoringWhiteSpace.h │ │ │ │ ├── HCIsEqualToNumber.h │ │ │ │ ├── HCIsIn.h │ │ │ │ ├── HCIsInstanceOf.h │ │ │ │ ├── HCIsNil.h │ │ │ │ ├── HCIsNot.h │ │ │ │ ├── HCIsSame.h │ │ │ │ ├── HCMatcher.h │ │ │ │ ├── HCNumberAssert.h │ │ │ │ ├── HCOrderingComparison.h │ │ │ │ ├── HCRequireNonNilObject.h │ │ │ │ ├── HCRequireNonNilString.h │ │ │ │ ├── HCSelfDescribing.h │ │ │ │ ├── HCStringContains.h │ │ │ │ ├── HCStringDescription.h │ │ │ │ ├── HCStringEndsWith.h │ │ │ │ ├── HCStringStartsWith.h │ │ │ │ ├── HCSubstringMatcher.h │ │ │ │ ├── HCWrapInMatcher.h │ │ │ │ ├── NSObject+HCSelfDescribingValue.h │ │ │ │ └── OCHamcrestIOS.h │ │ │ ├── OCHamcrestIOS │ │ │ └── Resources │ │ │ │ ├── Info.plist │ │ │ │ └── LICENSE.txt │ │ │ └── Current │ │ ├── OCMock.framework │ │ ├── Headers │ │ ├── OCMock │ │ ├── Resources │ │ └── Versions │ │ │ ├── A │ │ │ ├── Headers │ │ │ │ ├── NSNotificationCenter+OCMAdditions.h │ │ │ │ ├── OCMArg.h │ │ │ │ ├── OCMConstraint.h │ │ │ │ ├── OCMock.h │ │ │ │ ├── OCMockObject.h │ │ │ │ └── OCMockRecorder.h │ │ │ ├── OCMock │ │ │ └── Resources │ │ │ │ ├── Info.plist │ │ │ │ └── License.txt │ │ │ └── Current │ │ └── OCMock │ │ ├── Headers │ │ ├── NSNotificationCenter+OCMAdditions.h │ │ ├── OCMArg.h │ │ ├── OCMConstraint.h │ │ ├── OCMock.h │ │ ├── OCMockObject.h │ │ └── OCMockRecorder.h │ │ └── libOCMock.a │ ├── MainWindow.xib │ ├── Unit Tests │ ├── SampleTestCase.h │ └── SampleTestCase.m │ ├── ___PROJECTNAMEASIDENTIFIER___-Info.plist │ ├── ___PROJECTNAMEASIDENTIFIER___Tests-Info.plist │ ├── ___PROJECTNAMEASIDENTIFIER____Prefix.pch │ ├── ___PROJECTNAME___.xcodeproj │ ├── TemplateIcon.icns │ ├── TemplateInfo.plist │ └── project.pbxproj │ └── main.m └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | **/.DS_Store -------------------------------------------------------------------------------- /File Templates/OCUnit Test.xctemplate/TemplateIcon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicalpanda/Xcode-Templates/b3d29d42246abe84f6dce10f7a55d6d62abfdee3/File Templates/OCUnit Test.xctemplate/TemplateIcon.icns -------------------------------------------------------------------------------- /File Templates/OCUnit Test.xctemplate/TemplateInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AllowedTypes 6 | 7 | public.objective-c-source 8 | public.objective-c-plus-plus-source 9 | 10 | DefaultCompletionName 11 | TestCase 12 | Description 13 | A simpler OCUnit test case. Remember to set the target to be your test target. 14 | Kind 15 | Xcode.IDEKit.TextSubstitutionFileTemplateKind 16 | MainTemplateFile 17 | ___FILEBASENAME___.m 18 | CFBundleIdentifier 19 | 20 | Platforms 21 | 22 | com.apple.platform.iphoneos 23 | com.apple.platform.macosx 24 | 25 | Summary 26 | A single file OCUnit Test Case. 27 | 28 | 29 | -------------------------------------------------------------------------------- /File Templates/OCUnit Test.xctemplate/___FILEBASENAME___.m: -------------------------------------------------------------------------------- 1 | // 2 | // Test Case: ___FILEBASENAME___ 3 | // Created by ___FULLUSERNAME___ on ___DATE___ 4 | // Copyright © ___YEAR___ by ___ORGANIZATIONNAME___ 5 | // 6 | 7 | #import 8 | 9 | @interface ___FILEBASENAMEASIDENTIFIER___ : SenTestCase 10 | @end 11 | 12 | 13 | @implementation ___FILEBASENAMEASIDENTIFIER___ 14 | 15 | - (void)setUp 16 | { 17 | } 18 | 19 | - (void)tearDown 20 | { 21 | } 22 | 23 | - (void)testExample 24 | { 25 | STFail(@"Not Implemented"); 26 | } 27 | 28 | @end -------------------------------------------------------------------------------- /File Templates/Speca Spec.xctemplate/TemplateIcon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicalpanda/Xcode-Templates/b3d29d42246abe84f6dce10f7a55d6d62abfdee3/File Templates/Speca Spec.xctemplate/TemplateIcon.icns -------------------------------------------------------------------------------- /File Templates/Speca Spec.xctemplate/TemplateInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AllowedTypes 6 | 7 | public.objective-c-source 8 | public.objective-c-plus-plus-source 9 | 10 | DefaultCompletionName 11 | TestCase 12 | Description 13 | A Kiwi specification set up to test a class. Remember to set the target to be your test target. 14 | Kind 15 | Xcode.IDEKit.TextSubstitutionFileTemplateKind 16 | MainTemplateFile 17 | ___FILEBASENAME___.m 18 | CFBundleIdentifier 19 | 20 | Platforms 21 | 22 | com.apple.platform.iphoneos 23 | com.apple.platform.macosx 24 | 25 | Summary 26 | A Kiwi specification. 27 | 28 | 29 | -------------------------------------------------------------------------------- /File Templates/Speca Spec.xctemplate/___FILEBASENAME___.m: -------------------------------------------------------------------------------- 1 | // A Specta Test for ___FILEBASENAME___ 2 | 3 | 4 | SpecBegin(___FILEBASENAME___) 5 | 6 | describe(@"___FILEBASENAME___", ^{ 7 | 8 | context(@"On loading", ^{ 9 | __block NSObject *object = nil; 10 | 11 | beforeEach(^{ 12 | object = [[NSObject alloc] init]; 13 | }); 14 | 15 | it(@"should exist", ^{ 16 | STAssertNotNil(object, @"should not be nil"); 17 | }); 18 | 19 | }); 20 | }); 21 | 22 | SpecEnd 23 | -------------------------------------------------------------------------------- /Project Templates/Cocoa Framework with Macruby Tests/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Project Templates/Cocoa Framework with Macruby Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.yourcompany.${PRODUCT_NAME:rfc1034Identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Project Templates/Cocoa Framework with Macruby Tests/Tests/Gemfile: -------------------------------------------------------------------------------- 1 | source :rubygems 2 | 3 | gem 'bacon' 4 | gem 'rack' 5 | gem 'dispatch' 6 | -------------------------------------------------------------------------------- /Project Templates/Cocoa Framework with Macruby Tests/Tests/Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: http://rubygems.org/ 3 | specs: 4 | bacon (1.1.0) 5 | dispatch (0.0.1) 6 | rack (1.2.2) 7 | 8 | PLATFORMS 9 | ruby 10 | 11 | DEPENDENCIES 12 | bacon 13 | dispatch 14 | rack 15 | -------------------------------------------------------------------------------- /Project Templates/Cocoa Framework with Macruby Tests/Tests/run_suite.rb: -------------------------------------------------------------------------------- 1 | # ___PROJECTNAME___ 2 | # 3 | # Created by ___FULLUSERNAME___ on ___DATE___. 4 | # Copyright ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. 5 | 6 | 7 | puts "Running Test Suite" 8 | 9 | puts "Loading Dependencies" 10 | require 'rubygems' 11 | require 'bundler' 12 | Bundler.require 13 | 14 | # Tell MacRuby where to find our framework 15 | ENV['DYLD_FRAMEWORK_PATH'] = ENV['BUILT_PRODUCTS_DIR'] 16 | puts "Framework location: #{ENV['DYLD_FRAMEWORK_PATH']}" 17 | 18 | # Setup Bacon to report on tests at the end 19 | Bacon.summary_on_exit 20 | 21 | puts "Running Tests" 22 | # Load all of the *_spec test files in the test bundle 23 | Dir.glob('**/*_spec.rb').each do |test_file| 24 | puts "#{test_file}" 25 | require test_file 26 | end -------------------------------------------------------------------------------- /Project Templates/Cocoa Framework with Macruby Tests/Tests/sample_spec.rb: -------------------------------------------------------------------------------- 1 | # sample_spec.rb 2 | # ___PROJECTNAME___ 3 | # 4 | # Created by ___FULLUSERNAME___ on ___DATE___. 5 | # Copyright ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. 6 | 7 | 8 | describe "Sample Specification" do 9 | 10 | it "should pass" do 11 | 1.should == 1 12 | end 13 | 14 | it "should fail" do 15 | 1.should == 2 16 | end 17 | end -------------------------------------------------------------------------------- /Project Templates/Cocoa Framework with Macruby Tests/Tests/spec_helper.rb: -------------------------------------------------------------------------------- 1 | # spec_helper.rb 2 | # ___PROJECTNAME___ 3 | # 4 | # Created by ___FULLUSERNAME___ on ___DATE___. 5 | # Copyright ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. 6 | 7 | 8 | 9 | framework "___PROJECTNAME___" 10 | -------------------------------------------------------------------------------- /Project Templates/Cocoa Framework with Macruby Tests/___PROJECTNAME___.xcodeproj/TemplateIcon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicalpanda/Xcode-Templates/b3d29d42246abe84f6dce10f7a55d6d62abfdee3/Project Templates/Cocoa Framework with Macruby Tests/___PROJECTNAME___.xcodeproj/TemplateIcon.icns -------------------------------------------------------------------------------- /Project Templates/Cocoa Framework with Macruby Tests/___PROJECTNAME___.xcodeproj/TemplateInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Description 6 | This project sets up a Desktop Cocoa Framework project with a Unit Test bundle based on MacRuby and bacon 7 | 8 | 9 | -------------------------------------------------------------------------------- /Project Templates/Cocoa Framework with Macruby Tests/___PROJECTNAME___Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Project Templates/Cocoa Framework with Macruby Tests/___PROJECTNAME____Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Cocoa Framework with MacRuby Unit Tests' target in the 'Cocoa Framework with MacRuby Unit Tests' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Classes/___PROJECTNAMEASIDENTIFIER___AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // ___PROJECTNAME___AppDelegate.h 3 | // 4 | // Created by ___FULLUSERNAME___ on ___DATE___. 5 | // Copyright ___YEAR___ ___ORGANIZATIONNAME___ rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface ___PROJECTNAME___AppDelegate : NSObject {} 11 | 12 | @property (nonatomic, retain) IBOutlet UIWindow *window; 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Classes/___PROJECTNAMEASIDENTIFIER___AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // ___PROJECTNAME___AppDelegate.m 3 | // 4 | // Created by ___FULLUSERNAME___ on ___DATE___. 5 | // Copyright ___YEAR___ ___ORGANIZATIONNAME___ rights reserved. 6 | // 7 | 8 | #import "___PROJECTNAMEASIDENTIFIER___AppDelegate.h" 9 | 10 | @implementation ___PROJECTNAMEASIDENTIFIER___AppDelegate 11 | 12 | @synthesize window = window_; 13 | 14 | 15 | - (void)dealloc 16 | { 17 | self.window = nil; 18 | [super dealloc]; 19 | } 20 | 21 | #pragma mark - 22 | #pragma mark Application lifecycle 23 | 24 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 25 | { 26 | [self.window makeKeyAndVisible]; 27 | 28 | return YES; 29 | } 30 | 31 | @end -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/GHUnitIOS.framework/GHUnitIOS: -------------------------------------------------------------------------------- 1 | Versions/Current/GHUnitIOS -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/GHUnitIOS.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/GHUnitIOS.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/GHUnitIOS.framework/Versions/A/GHUnitIOS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicalpanda/Xcode-Templates/b3d29d42246abe84f6dce10f7a55d6d62abfdee3/Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/GHUnitIOS.framework/Versions/A/GHUnitIOS -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/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 | // Some default statuses to use; Or define and use your own 33 | enum { 34 | kGHUnitWaitStatusUnknown = 0, //!< Unknown wait status 35 | kGHUnitWaitStatusSuccess, //!< Wait status success 36 | kGHUnitWaitStatusFailure, //!< Wait status failure 37 | kGHUnitWaitStatusCancelled //!< Wait status cancelled 38 | }; 39 | 40 | /*! 41 | Asynchronous test case with wait and notify. 42 | 43 | If notify occurs before wait has started (if it was a synchronous call), this test 44 | case will still work. 45 | 46 | Be sure to call prepare before the asynchronous method (otherwise an exception will raise). 47 | 48 | @code 49 | 50 | @interface MyAsyncTest : GHAsyncTestCase { } 51 | @end 52 | 53 | @implementation MyAsyncTest 54 | 55 | - (void)testSuccess { 56 | [self prepare]; 57 | 58 | // Do asynchronous task here 59 | [self performSelector:@selector(_succeed) withObject:nil afterDelay:0.1]; 60 | 61 | [self waitForStatus:kGHUnitWaitStatusSuccess timeout:1.0]; 62 | } 63 | 64 | - (void)_succeed { 65 | // Notice the forSelector points to the test above. This is so that 66 | // stray notifies don't error or falsely succeed other tests. 67 | // To ignore the check, forSelector can be NULL. 68 | [self notify:kGHUnitWaitStatusSuccess forSelector:@selector(testSuccess)]; 69 | } 70 | 71 | @end 72 | @endcode 73 | */ 74 | @interface GHAsyncTestCase : GHTestCase { 75 | 76 | NSInteger waitForStatus_; 77 | NSInteger notifiedStatus_; 78 | 79 | BOOL prepared_; // Whether prepared was called before waitForStatus:timeout: 80 | NSRecursiveLock *lock_; // Lock to synchronize on 81 | SEL waitSelector_; // The selector we are waiting on 82 | 83 | NSArray *_runLoopModes; 84 | } 85 | 86 | /*! 87 | Run loop modes to run while waiting; 88 | Defaults to NSDefaultRunLoopMode, NSRunLoopCommonModes, NSConnectionReplyMode 89 | */ 90 | @property (retain, nonatomic) NSArray *runLoopModes; 91 | 92 | /*! 93 | Prepare before calling the asynchronous method. 94 | */ 95 | - (void)prepare; 96 | 97 | /*! 98 | Prepare and specify the selector we will use in notify. 99 | @param selector 100 | */ 101 | - (void)prepare:(SEL)selector; 102 | 103 | /*! 104 | Wait for notification of status or timeout. 105 | 106 | Be sure to prepare before calling your asynchronous method. 107 | For example, 108 | 109 | @code 110 | - (void)testFoo { 111 | [self prepare]; 112 | // Do asynchronous task here 113 | [self waitForStatus:kGHUnitWaitStatusSuccess timeout:1.0]; 114 | } 115 | @endcode 116 | 117 | @param status kGHUnitWaitStatusSuccess, kGHUnitWaitStatusFailure or custom status 118 | @param timeout Timeout in seconds 119 | */ 120 | - (void)waitForStatus:(NSInteger)status timeout:(NSTimeInterval)timeout; 121 | 122 | /*! 123 | @deprecated 124 | */ 125 | - (void)waitFor:(NSInteger)status timeout:(NSTimeInterval)timeout; 126 | 127 | /*! 128 | Wait for timeout to occur. 129 | Fails if we did _NOT_ timeout. 130 | @param timeout 131 | */ 132 | - (void)waitForTimeout:(NSTimeInterval)timeout; 133 | 134 | /*! 135 | Notify waiting of status for test selector. 136 | @param status Status, for example, kGHUnitWaitStatusSuccess 137 | @param selector If not NULL, then will verify this selector is where we are waiting. 138 | This prevents stray asynchronous callbacks to fail a later test 139 | */ 140 | - (void)notify:(NSInteger)status forSelector:(SEL)selector; 141 | 142 | /*! 143 | Notify waiting of status for any selector. 144 | @param status Status, for example, kGHUnitWaitStatusSuccess 145 | */ 146 | - (void)notify:(NSInteger)status; 147 | 148 | /*! 149 | Run the run loops for the specified interval. 150 | @param interval 151 | @author Adapted from Robert Palmer, pauseForTimeout 152 | */ 153 | - (void)runForInterval:(NSTimeInterval)interval; 154 | 155 | @end 156 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/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 Hudson) 39 | */ 40 | - (NSString *)JUnitXML; 41 | 42 | @end 43 | 44 | //! @endcond 45 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/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 | //! @cond DEV 31 | 32 | /*! 33 | Test status. 34 | */ 35 | typedef enum { 36 | GHTestStatusNone = 0, 37 | GHTestStatusRunning, // Test is running 38 | GHTestStatusCancelling, // Test is being cancelled 39 | GHTestStatusCancelled, // Test was cancelled 40 | GHTestStatusSucceeded, // Test finished and succeeded 41 | GHTestStatusErrored, // Test finished and errored 42 | } GHTestStatus; 43 | 44 | enum { 45 | GHTestOptionReraiseExceptions = 1 << 0, // Allows exceptions to be raised (so you can trigger the debugger) 46 | GHTestOptionForceSetUpTearDownClass = 1 << 1, // Runs setUpClass/tearDownClass for this (each) test; Used when re-running a single test in a group 47 | }; 48 | typedef NSInteger GHTestOptions; 49 | 50 | /*! 51 | Generate string from GHTestStatus 52 | @param status 53 | */ 54 | extern NSString* NSStringFromGHTestStatus(GHTestStatus status); 55 | 56 | /*! 57 | Check if test is running (or trying to cancel). 58 | */ 59 | extern BOOL GHTestStatusIsRunning(GHTestStatus status); 60 | 61 | /*! 62 | Check if test has succeeded, errored or cancelled. 63 | */ 64 | extern BOOL GHTestStatusEnded(GHTestStatus status); 65 | 66 | /*! 67 | Test stats. 68 | */ 69 | typedef struct { 70 | NSInteger succeedCount; // Number of succeeded tests 71 | NSInteger failureCount; // Number of failed tests 72 | NSInteger cancelCount; // Number of aborted tests 73 | NSInteger testCount; // Total number of tests 74 | } GHTestStats; 75 | 76 | /*! 77 | Create GHTestStats. 78 | */ 79 | extern GHTestStats GHTestStatsMake(NSInteger succeedCount, NSInteger failureCount, NSInteger cancelCount, NSInteger testCount); 80 | 81 | extern const GHTestStats GHTestStatsEmpty; 82 | 83 | extern NSString *NSStringFromGHTestStats(GHTestStats stats); 84 | 85 | @protocol GHTestDelegate; 86 | 87 | /*! 88 | The base interface for a runnable test. 89 | A runnable with a unique identifier, display name, stats, timer, delegate, log and error handling. 90 | */ 91 | @protocol GHTest 92 | 93 | - (void)run:(GHTestOptions)options; 94 | 95 | @property (readonly, nonatomic) NSString *identifier; // Unique identifier for test 96 | @property (readonly, nonatomic) NSString *name; 97 | @property (assign, nonatomic) NSTimeInterval interval; 98 | @property (assign, nonatomic) GHTestStatus status; 99 | @property (readonly, nonatomic) GHTestStats stats; 100 | @property (retain, nonatomic) NSException *exception; 101 | @property (assign, nonatomic, getter=isDisabled) BOOL disabled; 102 | @property (assign, nonatomic, getter=isHidden) BOOL hidden; 103 | @property (assign, nonatomic) id delegate; // weak 104 | 105 | - (NSArray *)log; 106 | 107 | - (void)reset; 108 | - (void)cancel; 109 | 110 | - (NSInteger)disabledCount; 111 | 112 | @end 113 | 114 | /*! 115 | Test delegate for notification when a test starts and ends. 116 | */ 117 | @protocol GHTestDelegate 118 | - (void)testDidStart:(id)test source:(id)source; 119 | - (void)testDidUpdate:(id)test source:(id)source; 120 | - (void)testDidEnd:(id)test source:(id)source; 121 | - (void)test:(id)test didLog:(NSString *)message source:(id)source; 122 | @end 123 | 124 | /*! 125 | Delegate which is notified of log messages from inside GHTestCase. 126 | */ 127 | @protocol GHTestCaseLogWriter 128 | - (void)log:(NSString *)message testCase:(id)testCase; 129 | @end 130 | 131 | /*! 132 | Default test implementation with a target/selector pair. 133 | - Tests a target and selector 134 | - Notifies a test delegate 135 | - Keeps track of status, running time and failures 136 | - Stores any test specific logging 137 | */ 138 | @interface GHTest : NSObject { 139 | 140 | NSObject *delegate_; // weak 141 | 142 | id target_; 143 | SEL selector_; 144 | 145 | NSString *identifier_; 146 | NSString *name_; 147 | GHTestStatus status_; 148 | NSTimeInterval interval_; 149 | BOOL disabled_; 150 | BOOL hidden_; 151 | NSException *exception_; // If failed 152 | 153 | NSMutableArray *log_; 154 | 155 | } 156 | 157 | @property (readonly, nonatomic) id target; 158 | @property (readonly, nonatomic) SEL selector; 159 | @property (readonly, nonatomic) NSArray *log; 160 | 161 | /*! 162 | Create test with identifier, name. 163 | @param identifier Unique identifier 164 | @param name Name 165 | */ 166 | - (id)initWithIdentifier:(NSString *)identifier name:(NSString *)name; 167 | 168 | /*! 169 | Create test with target/selector. 170 | @param target Target (usually a test case) 171 | @param selector Selector (usually a test method) 172 | */ 173 | - (id)initWithTarget:(id)target selector:(SEL)selector; 174 | 175 | /*! 176 | Create autoreleased test with target/selector. 177 | @param target Target (usually a test case) 178 | @param selector Selector (usually a test method) 179 | */ 180 | + (id)testWithTarget:(id)target selector:(SEL)selector; 181 | 182 | @end 183 | 184 | //! @endcond 185 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/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. 54 | For example, 55 | @code 56 | GHTestLog(@"Some debug info, %@", obj); 57 | @endcode 58 | */ 59 | #define GHTestLog(...) [self log:[NSString stringWithFormat:__VA_ARGS__, nil]] 60 | 61 | /*! 62 | The base class for a test case. 63 | 64 | @code 65 | @interface MyTest : GHTestCase {} 66 | @end 67 | 68 | @implementation MyTest 69 | 70 | // Run before each test method 71 | - (void)setUp { } 72 | 73 | // Run after each test method 74 | - (void)tearDown { } 75 | 76 | // Run before the tests are run for this class 77 | - (void)setUpClass { } 78 | 79 | // Run before the tests are run for this class 80 | - (void)tearDownClass { } 81 | 82 | // Tests are prefixed by 'test' and contain no arguments and no return value 83 | - (void)testA { 84 | GHTestLog(@"Log with a test with the GHTestLog(...) for test specific logging."); 85 | } 86 | 87 | // Another test; Tests are run in lexical order 88 | - (void)testB { } 89 | 90 | // Override any exceptions; By default exceptions are raised, causing a test failure 91 | - (void)failWithException:(NSException *)exception { } 92 | 93 | @end 94 | @endcode 95 | 96 | */ 97 | @interface GHTestCase : NSObject { 98 | id logWriter_; // weak 99 | 100 | SEL currentSelector_; 101 | } 102 | 103 | //! The current test selector 104 | @property (assign, nonatomic) SEL currentSelector; 105 | @property (assign, nonatomic) id logWriter; 106 | 107 | // GTM_BEGIN 108 | //! Run before each test method 109 | - (void)setUp; 110 | 111 | //! Run after each test method 112 | - (void)tearDown; 113 | 114 | /*! 115 | By default exceptions are raised, causing a test failure 116 | @brief Override any exceptions 117 | @param exception Exception that was raised by test 118 | */ 119 | - (void)failWithException:(NSException*)exception; 120 | // GTM_END 121 | 122 | //! Run before the tests (once per test case) 123 | - (void)setUpClass; 124 | 125 | //! Run after the tests (once per test case) 126 | - (void)tearDownClass; 127 | 128 | /*! 129 | Whether to run the tests on a separate thread. Override this method in your 130 | test case to override the default. 131 | Default is NO, tests are run on a separate thread by default. 132 | @result If YES runs on the main thread 133 | */ 134 | - (BOOL)shouldRunOnMainThread; 135 | 136 | //! Any special handling of exceptions after they are thrown; By default logs stack trace to standard out. 137 | - (void)handleException:(NSException *)exception; 138 | 139 | /*! 140 | Log a message, which notifies the log delegate. 141 | This is not meant to be used directly, see GHTestLog(...) macro. 142 | @param message 143 | */ 144 | - (void)log:(NSString *)message; 145 | 146 | @end 147 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/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 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/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 | @brief 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 | - (NSString *)name; 41 | - (id)parent; 42 | - (NSArray *)children; 43 | @end 44 | 45 | /*! 46 | @brief A collection of tests (or test groups). 47 | 48 | A test group is a collection of id, that may represent a set of test case methods. 49 | 50 | For example, if you had the following GHTestCase. 51 | 52 | @code 53 | @interface FooTest : GHTestCase {} 54 | - (void)testFoo; 55 | - (void)testBar; 56 | @end 57 | @endcode 58 | 59 | The GHTestGroup would consist of and array of GHTest, [FooTest#testFoo and FooTest#testBar], 60 | each test being a target and selector pair. 61 | 62 | A test group may also consist of a group of groups (since GHTestGroup conforms to GHTest), 63 | and this might represent a GHTestSuite. 64 | */ 65 | @interface GHTestGroup : NSObject { 66 | 67 | NSObject *delegate_; // weak 68 | id parent_; // weak 69 | 70 | NSMutableArray */*of id*/children_; 71 | 72 | NSString *name_; // The name of the test group (usually the class name of the test case 73 | NSTimeInterval interval_; // Total time of child tests 74 | GHTestStatus status_; // Current status of the group (current status of running or completed child tests) 75 | GHTestStats stats_; // Current stats for the group (aggregate of child test stats) 76 | 77 | BOOL didSetUpClass_; 78 | 79 | GHTestOptions options_; 80 | 81 | // Set if test is created from initWithTestCase:delegate: 82 | // Allows use to perform setUpClass and tearDownClass (once per test case run) 83 | id testCase_; 84 | 85 | NSException *exception_; // If exception happens in group setUpClass/tearDownClass 86 | } 87 | 88 | @property (readonly, nonatomic) NSArray */*of id*/children; 89 | @property (assign, nonatomic) id parent; 90 | @property (readonly, nonatomic) id testCase; 91 | @property (assign, nonatomic) GHTestOptions options; 92 | 93 | /*! 94 | Create an empty test group. 95 | @param name The name of the test group 96 | @param delegate Delegate, notifies of test start and end 97 | @result New test group 98 | */ 99 | - (id)initWithName:(NSString *)name delegate:(id)delegate; 100 | 101 | /*! 102 | Create test group from a test case. 103 | @param testCase Test case, could be a subclass of SenTestCase or GHTestCase 104 | @param delegate Delegate, notifies of test start and end 105 | @result New test group 106 | */ 107 | - (id)initWithTestCase:(id)testCase delegate:(id)delegate; 108 | 109 | /*! 110 | Create test group from a single test. 111 | @param testCase 112 | @param selector Test to run 113 | @param delegate 114 | */ 115 | - (id)initWithTestCase:(id)testCase selector:(SEL)selector delegate:(id)delegate; 116 | 117 | /*! 118 | Create test group from a test case. 119 | @param testCase Test case, could be a subclass of SenTestCase or GHTestCase 120 | @param delegate Delegate, notifies of test start and end 121 | @result New test group 122 | */ 123 | + (GHTestGroup *)testGroupFromTestCase:(id)testCase delegate:(id)delegate; 124 | 125 | /*! 126 | Add a test case (or test group) to this test group. 127 | @param testCase Test case, could be a subclass of SenTestCase or GHTestCase 128 | */ 129 | - (void)addTestCase:(id)testCase; 130 | 131 | /*! 132 | Add a test group to this test group. 133 | @param testGroup Test group to add 134 | */ 135 | - (void)addTestGroup:(GHTestGroup *)testGroup; 136 | 137 | /*! 138 | Add tests to this group. 139 | @param tests Tests to add 140 | */ 141 | - (void)addTests:(NSArray */*of id*/)tests; 142 | 143 | /*! 144 | Add test to this group. 145 | @param test Test to add 146 | */ 147 | - (void)addTest:(id)test; 148 | 149 | /*! 150 | Whether the test group should run on the main thread. 151 | Call passes to test case instance if enabled. 152 | */ 153 | - (BOOL)shouldRunOnMainThread; 154 | 155 | /*! 156 | @result YES if we have any enabled chilren, NO if all children have been disabled. 157 | */ 158 | - (BOOL)hasEnabledChildren; 159 | 160 | /*! 161 | Get list of failed tests. 162 | @result Failed tests 163 | */ 164 | - (NSArray */*of id*/)failedTests; 165 | 166 | /*! 167 | Run in operation queue. 168 | Tests from the group are added and will block until they have completed. 169 | @param operationQueue If nil, then runs as is 170 | @param options Options 171 | */ 172 | - (void)runInOperationQueue:(NSOperationQueue *)operationQueue options:(GHTestOptions)options; 173 | 174 | @end 175 | 176 | //! @endcond 177 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/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 | //! @cond DEV 31 | 32 | #import "GHTest.h" 33 | 34 | /*! 35 | Test for running in the context of an NSOperationQueue. 36 | */ 37 | @interface GHTestOperation : NSOperation { 38 | id test_; 39 | GHTestOptions options_; 40 | } 41 | 42 | - (id)initWithTest:(id)test options:(GHTestOptions)options; 43 | 44 | @end 45 | 46 | //! @endcond 47 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/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 | // Delegates can be guaranteed to be notified on the main thread (using #delegateOnMainThread) 56 | @protocol GHTestRunnerDelegate 57 | @optional 58 | - (void)testRunnerDidStart:(GHTestRunner *)runner; 59 | - (void)testRunner:(GHTestRunner *)runner didStartTest:(id)test; // Test started 60 | - (void)testRunner:(GHTestRunner *)runner didUpdateTest:(id)test; // Test changed 61 | - (void)testRunner:(GHTestRunner *)runner didEndTest:(id)test; // Test finished 62 | - (void)testRunnerDidCancel:(GHTestRunner *)runner; 63 | - (void)testRunnerDidEnd:(GHTestRunner *)runner; 64 | 65 | - (void)testRunner:(GHTestRunner *)runner didLog:(NSString *)message; // Runner logged message 66 | - (void)testRunner:(GHTestRunner *)runner test:(id)test didLog:(NSString *)message; // Test logged message 67 | @end 68 | 69 | /*! 70 | Runs the tests. 71 | Tests are run a separate thread though delegates are called on the 72 | main thread by default (see #delegateOnMainThread). 73 | */ 74 | @interface GHTestRunner : NSObject { 75 | 76 | id test_; // The test to run; Could be a GHTestGroup (suite), GHTestGroup (test case), or GHTest (target/selector) 77 | 78 | NSObject *delegate_; // weak 79 | 80 | GHTestOptions options_; 81 | 82 | BOOL running_; 83 | BOOL cancelling_; 84 | 85 | NSTimeInterval startInterval_; 86 | 87 | NSOperationQueue *operationQueue_; //! If running a suite in operation queue 88 | } 89 | 90 | @property (retain) id test; 91 | @property (assign) NSObject *delegate; 92 | @property (assign) GHTestOptions options; 93 | @property (readonly) GHTestStats stats; 94 | @property (readonly, getter=isRunning) BOOL running; 95 | @property (readonly, getter=isCancelling) BOOL cancelling; 96 | @property (readonly) NSTimeInterval interval; 97 | @property (retain, nonatomic) NSOperationQueue *operationQueue; 98 | 99 | 100 | /*! 101 | Create runner for test. 102 | @param test 103 | */ 104 | - (id)initWithTest:(id)test; 105 | 106 | /*! 107 | Create runner for all tests. 108 | @see GHTesting#loadAllTestCases. 109 | @result Runner 110 | */ 111 | + (GHTestRunner *)runnerForAllTests; 112 | 113 | /*! 114 | Create runner for test suite. 115 | @param suite 116 | @result Runner 117 | */ 118 | + (GHTestRunner *)runnerForSuite:(GHTestSuite *)suite; 119 | 120 | /*! 121 | Create runner for class and method. 122 | @param testClassName 123 | @param methodName 124 | @result Runner 125 | */ 126 | + (GHTestRunner *)runnerForTestClassName:(NSString *)testClassName methodName:(NSString *)methodName; 127 | 128 | /*! 129 | Get the runner from the environment. 130 | If the TEST env is set, then we will only run that test case or test method. 131 | */ 132 | + (GHTestRunner *)runnerFromEnv; 133 | 134 | /*! 135 | Run the test runner. Usually called from the test main. 136 | Reads the TEST environment variable and filters on that; or all tests are run. 137 | @result 0 is success, otherwise the failure count 138 | */ 139 | + (int)run; 140 | 141 | - (void)runInBackground; 142 | 143 | /*! 144 | Start the test runner with the default test. 145 | @result 0 is success, otherwise the failure count 146 | */ 147 | - (int)runTests; 148 | 149 | - (void)cancel; 150 | 151 | - (void)setInParallel:(BOOL)inParallel; 152 | - (BOOL)isInParallel; 153 | 154 | /*! 155 | Write message to console. 156 | */ 157 | - (void)log:(NSString *)message; 158 | 159 | @end 160 | 161 | //! @endcond 162 | 163 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/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 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 99 | @param 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)writeJUnitXML:(NSError **)error; 115 | 116 | @end 117 | 118 | //! @endcond 119 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/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 | #ifdef __cplusplus 52 | extern "C" NSString *GHUStackTraceFromException(NSException *e); 53 | #else 54 | extern NSString *GHUStackTraceFromException(NSException *e); 55 | #endif 56 | 57 | // GTM_BEGIN 58 | BOOL isTestFixtureOfClass(Class aClass, Class testCaseClass); 59 | // GTM_END 60 | 61 | /*! 62 | Utility test for loading and running tests. 63 | @note Much of this is borrowed from GTM/UnitTesting. 64 | */ 65 | @interface GHTesting : NSObject { 66 | 67 | NSMutableArray/* of NSString*/ *testCaseClassNames_; 68 | 69 | } 70 | 71 | /*! 72 | The shared testing instance. 73 | */ 74 | + (GHTesting *)sharedInstance; 75 | 76 | /*! 77 | Load all test classes that we can "see". 78 | @result Array of initialized (and autoreleased) test case classes in an autoreleased array. 79 | */ 80 | - (NSArray *)loadAllTestCases; 81 | 82 | /*! 83 | Load tests from 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 | */ 91 | - (BOOL)isTestCaseClass:(Class)aClass; 92 | 93 | /*! 94 | Register test case class. 95 | @param aClass 96 | */ 97 | - (void)registerClass:(Class)aClass; 98 | 99 | /*! 100 | Register test case class by name. 101 | @param className Class name (via NSStringFromClass(aClass) 102 | */ 103 | - (void)registerClassName:(NSString *)className; 104 | 105 | /*! 106 | Format test exception. 107 | @param exception 108 | @result Description 109 | */ 110 | + (NSString *)descriptionForException:(NSException *)exception; 111 | 112 | /*! 113 | Filename for cause of test exception. 114 | @param test 115 | @result Filename 116 | */ 117 | + (NSString *)exceptionFilenameForTest:(id)test; 118 | 119 | /*! 120 | Line number for cause of test exception. 121 | @param test 122 | @result Line number 123 | */ 124 | + (NSInteger)exceptionLineNumberForTest:(id)test; 125 | 126 | /*! 127 | Run test. 128 | @param target 129 | @param selector 130 | @param exception Exception, if set, is retained and should be released by the caller. 131 | @param interval Time to run the test 132 | @param reraiseExceptions If YES, will re-raise exceptions 133 | */ 134 | + (BOOL)runTestWithTarget:(id)target selector:(SEL)selector exception:(NSException **)exception 135 | interval:(NSTimeInterval *)interval reraiseExceptions:(BOOL)reraiseExceptions; 136 | 137 | /*! 138 | Same as normal runTest without catching exceptions. 139 | */ 140 | + (BOOL)runTestOrRaiseWithTarget:(id)target selector:(SEL)selector exception:(NSException **)exception interval:(NSTimeInterval *)interval; 141 | 142 | @end 143 | 144 | @protocol GHSenTestCase 145 | - (void)raiseAfterFailure; 146 | @end 147 | 148 | //! @endcond 149 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/GHUnitIOS.framework/Versions/A/Headers/GHUnitIPhoneAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHUnitIPhoneAppDelegate.h 3 | // GHUnitIPhone 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 | @interface GHUnitIPhoneAppDelegate : NSObject { 33 | UIWindow *window_; 34 | 35 | UINavigationController *navigationController_; 36 | } 37 | 38 | @end 39 | 40 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/GHUnitIOS.framework/Versions/A/Headers/GHUnitIPhoneTableViewDataSource.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHUnitIPhoneTableViewDataSource.h 3 | // GHUnitIPhone 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 "GHTestViewModel.h" 31 | 32 | @interface GHUnitIPhoneTableViewDataSource : GHTestViewModel { 33 | 34 | } 35 | 36 | - (GHTestNode *)nodeForIndexPath:(NSIndexPath *)indexPath; 37 | 38 | - (void)setSelectedForAllNodes:(BOOL)selected; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/GHUnitIOS.framework/Versions/A/Headers/GHUnitIPhoneTestViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHUnitIPhoneTestViewController.h 3 | // GHUnitIPhone 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 "GHTestViewModel.h" 31 | 32 | @interface GHUnitIPhoneTestViewController : UIViewController { 33 | UITextView *textView_; 34 | 35 | GHTestNode *testNode_; 36 | 37 | GHTestRunner *runner_; 38 | } 39 | 40 | - (void)setTest:(id)test; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/GHUnitIOS.framework/Versions/A/Headers/GHUnitIPhoneView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHUnitIPhoneView.h 3 | // GHUnitIPhone 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 | 31 | @interface GHUnitIPhoneView : UIView { 32 | UISearchBar *searchBar_; 33 | 34 | UITableView *tableView_; 35 | 36 | //! Status label at bottom of the view 37 | UILabel *statusLabel_; 38 | 39 | UISegmentedControl *filterControl_; 40 | 41 | UIToolbar *runToolbar_; 42 | 43 | UIView *footerView_; 44 | } 45 | 46 | @property (readonly, nonatomic) UILabel *statusLabel; 47 | @property (readonly, nonatomic) UISegmentedControl *filterControl; 48 | @property (readonly, nonatomic) UISearchBar *searchBar; 49 | @property (readonly, nonatomic) UITableView *tableView; 50 | 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/GHUnitIOS.framework/Versions/A/Headers/GHUnitIPhoneViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GHUnitIPhoneViewController.h 3 | // GHUnitIPhone 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 "GHUnitIPhoneView.h" 31 | 32 | #import "GHUnitIPhoneTableViewDataSource.h" 33 | #import "GHUnitIPhoneTestViewController.h" 34 | 35 | @interface GHUnitIPhoneViewController : UIViewController { 36 | 37 | GHUnitIPhoneView *view_; 38 | 39 | //! Data source for table view 40 | GHUnitIPhoneTableViewDataSource *dataSource_; 41 | GHTestSuite *suite_; 42 | 43 | UIBarButtonItem *runButton_; 44 | 45 | //! If set then we will no longer auto scroll as tests are run 46 | BOOL userDidDrag_; 47 | 48 | } 49 | 50 | @property (retain, nonatomic) GHTestSuite *suite; 51 | 52 | - (void)reloadTest:(id)test; 53 | 54 | - (void)scrollToTest:(id)test; 55 | - (void)scrollToBottom; 56 | 57 | - (void)setStatusText:(NSString *)message; 58 | 59 | - (void)runTests; 60 | 61 | - (void)cancel; 62 | 63 | - (void)reload; 64 | 65 | - (void)loadDefaults; 66 | - (void)saveDefaults; 67 | 68 | - (GHUnitIPhoneTableViewDataSource *)dataSource; 69 | 70 | @end 71 | 72 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/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 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/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 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/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 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/GHUnitIOS.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/GHUnitIOSTestMain.m: -------------------------------------------------------------------------------- 1 | // 2 | // GHUnitIOSTestMain.m 3 | // GHUnitIPhone 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 | // If you are using the framework 33 | #import 34 | // If you are using the static library and importing header files manually 35 | //#import "GHUnitIOS.h" 36 | 37 | // Default exception handler 38 | void exceptionHandler(NSException *exception) { 39 | NSLog(@"%@\n%@", [exception reason], GHUStackTraceFromException(exception)); 40 | } 41 | 42 | int main(int argc, char *argv[]) { 43 | 44 | /*! 45 | For debugging: 46 | Go into the "Get Info" contextual menu of your (test) executable (inside the "Executables" group in the left panel of XCode). 47 | Then go in the "Arguments" tab. You can add the following environment variables: 48 | 49 | Default: Set to: 50 | NSDebugEnabled NO "YES" 51 | NSZombieEnabled NO "YES" 52 | NSDeallocateZombies NO "YES" 53 | NSHangOnUncaughtException NO "YES" 54 | 55 | NSEnableAutoreleasePool YES "NO" 56 | NSAutoreleaseFreedObjectCheckEnabled NO "YES" 57 | NSAutoreleaseHighWaterMark 0 non-negative integer 58 | NSAutoreleaseHighWaterResolution 0 non-negative integer 59 | 60 | For info on these varaiables see NSDebug.h; http://theshadow.uw.hu/iPhoneSDKdoc/Foundation.framework/NSDebug.h.html 61 | 62 | For malloc debugging see: http://developer.apple.com/mac/library/documentation/Performance/Conceptual/ManagingMemory/Articles/MallocDebug.html 63 | */ 64 | 65 | NSSetUncaughtExceptionHandler(&exceptionHandler); 66 | 67 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 68 | 69 | // Register any special test case classes 70 | //[[GHTesting sharedInstance] registerClassName:@"GHSpecialTestCase"]; 71 | 72 | int retVal = 0; 73 | // If GHUNIT_CLI is set we are using the command line interface and run the tests 74 | // Otherwise load the GUI app 75 | if (getenv("GHUNIT_CLI")) { 76 | retVal = [GHTestRunner run]; 77 | } else { 78 | retVal = UIApplicationMain(argc, argv, nil, @"GHUnitIPhoneAppDelegate"); 79 | } 80 | [pool release]; 81 | return retVal; 82 | } -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/OCHamcrestIOS: -------------------------------------------------------------------------------- 1 | Versions/Current/OCHamcrestIOS -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCAllOf.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCAllOf.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Calculates the logical conjunction of multiple matchers. 14 | 15 | Evaluation is shortcut, so subsequent matchers are not called if an earlier matcher returns 16 | @c NO. 17 | 18 | @ingroup core_matchers 19 | */ 20 | @interface HCAllOf : HCBaseMatcher 21 | { 22 | NSArray *matchers; 23 | } 24 | 25 | + (id)allOf:(NSArray *)theMatchers; 26 | - (id)initWithMatchers:(NSArray *)theMatchers; 27 | 28 | @end 29 | 30 | //-------------------------------------------------------------------------------------------------- 31 | 32 | /** 33 | Evaluates to @c YES only if @em all of the given matchers evaluate to @c YES. 34 | 35 | @b Synonym: @ref allOf 36 | @param matcher1 Comma-separated list of matchers ending with @c nil. 37 | @see HCAllOf 38 | @ingroup core_matchers 39 | */ 40 | OBJC_EXPORT id HC_allOf(id matcher1, ...); 41 | 42 | /** 43 | allOf(matcher1, ...) - 44 | Evaluates to @c YES only if @em all of the given matchers evaluate to @c YES. 45 | 46 | Synonym for @ref HC_allOf, available if @c HC_SHORTHAND is defined. 47 | @param matcher1 Comma-separated list of matchers ending with @c nil. 48 | @see HCAllOf 49 | @ingroup core_matchers 50 | */ 51 | #ifdef HC_SHORTHAND 52 | #define allOf HC_allOf 53 | #endif 54 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCAnyOf.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCAnyOf.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Calculates the logical disjunction of multiple matchers. 14 | 15 | Evaluation is shortcut, so the subsequent matchers are not called if an earlier matcher returns 16 | @c YES. 17 | 18 | @ingroup core_matchers 19 | */ 20 | @interface HCAnyOf : HCBaseMatcher 21 | { 22 | NSArray *matchers; 23 | } 24 | 25 | + (id)anyOf:(NSArray *)theMatchers; 26 | - (id)initWithMatchers:(NSArray *)theMatchers; 27 | 28 | @end 29 | 30 | //-------------------------------------------------------------------------------------------------- 31 | 32 | /** 33 | Evaluates to @c YES if @em any of the given matchers evaluate to @c YES. 34 | 35 | @b Synonym: @ref anyOf 36 | @param matcher1 Comma-separated list of matchers ending with @c nil. 37 | @see HCAnyOf 38 | @ingroup core_matchers 39 | */ 40 | OBJC_EXPORT id HC_anyOf(id matcher1, ...); 41 | 42 | /** 43 | anyOf(matcher1, ...) - 44 | Evaluates to @c YES if @em any of the given matchers evaluate to @c YES. 45 | 46 | Synonym for @ref HC_anyOf, available if @c HC_SHORTHAND is defined. 47 | @param matcher1 Comma-separated list of matchers ending with @c nil. 48 | @see HCAnyOf 49 | @ingroup core_matchers 50 | */ 51 | #ifdef HC_SHORTHAND 52 | #define anyOf HC_anyOf 53 | #endif 54 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCAssertThat.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCAssertThat.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | #import 9 | 10 | @protocol HCMatcher; 11 | 12 | 13 | /** 14 | Asserts that actual value satisfies matcher. 15 | 16 | If the matcher is not satisfied, an exception describing the mismatch is thrown. If you have 17 | linked against a OCUnit-compatible testing framework, this exception is a test failure. 18 | 19 | @param testCase A test case object that answers to @c -failWithException: 20 | 21 | @ingroup integration 22 | */ 23 | OBJC_EXPORT void HC_assertThatWithLocation(id testCase, id actual, id matcher, 24 | const char *fileName, int lineNumber); 25 | 26 | /** 27 | Asserts that actual value satisfies matcher. 28 | 29 | If the matcher is not satisfied, an exception describing the mismatch is thrown. 30 | 31 | @b Synonym: @ref assertThat 32 | @see HC_assertThatWithLocation 33 | @ingroup integration 34 | */ 35 | #define HC_assertThat(actual, matcher) \ 36 | HC_assertThatWithLocation(self, actual, matcher, __FILE__, __LINE__) 37 | 38 | /** 39 | assertThat(actual, matcher) - 40 | Asserts that actual value satisfies matcher. 41 | 42 | If the matcher is not satisfied, an exception describing the mismatch is thrown. 43 | 44 | Synonym for @ref HC_assertThat, available if @c HC_SHORTHAND is defined. 45 | @see HC_assertThatWithLocation 46 | @ingroup integration 47 | */ 48 | #ifdef HC_SHORTHAND 49 | #define assertThat HC_assertThat 50 | #endif 51 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCBaseDescription.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCBaseDescription.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | #import 11 | 12 | 13 | /** 14 | Base class for all HCDescription implementations. 15 | 16 | @ingroup core 17 | */ 18 | @interface HCBaseDescription : NSObject 19 | @end 20 | 21 | 22 | /** 23 | Methods that must be provided by subclasses of HCBaseDescription. 24 | */ 25 | @interface HCBaseDescription (SubclassMustImplement) 26 | 27 | /** 28 | Append the string @a str to the description. 29 | */ 30 | - (void)append:(NSString *)str; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCBaseMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCBaseMatcher.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | #import 11 | 12 | // Convenience header, to provide OBJC_EXPORT 13 | #import 14 | 15 | 16 | /** 17 | Base class for all HCMatcher implementations. 18 | 19 | Most implementations can just implement @c -matches: and let 20 | -matches:describingMismatchTo: call it. But if it makes more sense to generate the 21 | mismatch description during the matching, override -matches:describingMismatchTo: and 22 | have @c -matches: call it with a @c nil description. 23 | 24 | @ingroup core 25 | */ 26 | @interface HCBaseMatcher : NSObject 27 | @end 28 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCBoxNumber.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCBoxNumber.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | #ifdef __cplusplus 9 | 10 | namespace hamcrest { 11 | 12 | /** 13 | Boxes scalar value in NSNumber, specialized per type. 14 | @ingroup number_matchers 15 | */ 16 | template 17 | inline 18 | NSNumber *boxNumber(T value) 19 | { return nil; } 20 | 21 | template <> 22 | inline 23 | NSNumber *boxNumber(BOOL value) 24 | { return [NSNumber numberWithBool:value]; } 25 | 26 | template <> 27 | inline 28 | NSNumber *boxNumber(char value) 29 | { return [NSNumber numberWithChar:value]; } 30 | 31 | template <> 32 | inline 33 | NSNumber *boxNumber(double value) 34 | { return [NSNumber numberWithDouble:value]; } 35 | 36 | template <> 37 | inline 38 | NSNumber *boxNumber(float value) 39 | { return [NSNumber numberWithFloat:value]; } 40 | 41 | template <> 42 | inline 43 | NSNumber *boxNumber(int value) 44 | { return [NSNumber numberWithInt:value]; } 45 | 46 | template <> 47 | inline 48 | NSNumber *boxNumber(long value) 49 | { return [NSNumber numberWithLong:value]; } 50 | 51 | template <> 52 | inline 53 | NSNumber *boxNumber(long long value) 54 | { return [NSNumber numberWithLongLong:value]; } 55 | 56 | template <> 57 | inline 58 | NSNumber *boxNumber(short value) 59 | { return [NSNumber numberWithShort:value]; } 60 | 61 | template <> 62 | inline 63 | NSNumber *boxNumber(unsigned char value) 64 | { return [NSNumber numberWithUnsignedChar:value]; } 65 | 66 | template <> 67 | inline 68 | NSNumber *boxNumber(unsigned int value) 69 | { return [NSNumber numberWithUnsignedInt:value]; } 70 | 71 | template <> 72 | inline 73 | NSNumber *boxNumber(unsigned long value) 74 | { return [NSNumber numberWithUnsignedLong:value]; } 75 | 76 | template <> 77 | inline 78 | NSNumber *boxNumber(unsigned long long value) 79 | { return [NSNumber numberWithUnsignedLongLong:value]; } 80 | 81 | template <> 82 | inline 83 | NSNumber *boxNumber(unsigned short value) 84 | { return [NSNumber numberWithUnsignedShort:value]; } 85 | 86 | } // namespace hamcrest 87 | 88 | #endif // __cplusplus 89 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCCollectMatchers.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCCollectMatchers.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | #import 9 | #import 10 | 11 | // C 12 | #import 13 | 14 | @protocol HCMatcher; 15 | 16 | 17 | /** 18 | Returns an array of matchers from a variable-length comma-separated list terminated by @c nil. 19 | @ingroup helpers 20 | */ 21 | OBJC_EXPORT NSMutableArray *HCCollectMatchers(id matcher1, va_list args); 22 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCDescribedAs.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCDescribedAs.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Provides a custom description to another matcher. 14 | @ingroup core_matchers 15 | */ 16 | @interface HCDescribedAs : HCBaseMatcher 17 | { 18 | NSString *descriptionTemplate; 19 | id matcher; 20 | NSArray *values; 21 | } 22 | 23 | + (id)describedAs:(NSString *)description 24 | forMatcher:(id)aMatcher 25 | overValues:(NSArray *)templateValues; 26 | 27 | - (id)initWithDescription:(NSString *)description 28 | forMatcher:(id)aMatcher 29 | overValues:(NSArray *)templateValues; 30 | 31 | @end 32 | 33 | //-------------------------------------------------------------------------------------------------- 34 | 35 | /** 36 | Wraps an existing matcher and overrides the description when it fails. 37 | 38 | Optional values following the matcher are substituted for \%0, \%1, etc., in the description. 39 | The last argument must be nil. 40 | 41 | @b Synonym: @ref describedAs 42 | @see HCDescribedAs 43 | @ingroup core_matchers 44 | */ 45 | OBJC_EXPORT id HC_describedAs(NSString *description, id matcher, ...); 46 | 47 | /** 48 | describedAs(description, matcher, ...) - 49 | Wraps an existing matcher and overrides the description when it fails. 50 | 51 | Optional values following the matcher are substituted for \%0, \%1, etc., in the description. 52 | The last argument must be nil. 53 | 54 | Synonym for @ref HC_describedAs, available if @c HC_SHORTHAND is defined. 55 | @see HCDescribedAs 56 | @ingroup core_matchers 57 | */ 58 | #ifdef HC_SHORTHAND 59 | #define describedAs HC_describedAs 60 | #endif 61 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCDescription.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCDescription.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | #import 9 | 10 | 11 | /** 12 | A description of an HCMatcher. 13 | 14 | An HCMatcher will describe itself to a description which can later be used for reporting. 15 | 16 | @ingroup core 17 | */ 18 | @protocol HCDescription 19 | 20 | /** 21 | Appends some plain text to the description. 22 | 23 | @return @c self, for chaining. 24 | */ 25 | - (id)appendText:(NSString *)text; 26 | 27 | /** 28 | Appends description of given value to @c self. 29 | 30 | If the value implements the @ref HCSelfDescribing protocol, then it will be used. 31 | 32 | @return @c self, for chaining. 33 | */ 34 | - (id)appendDescriptionOf:(id)value; 35 | 36 | /** 37 | Appends an arbitary value to the description. 38 | 39 | @b Deprecated: Call @ref appendDescriptionOf: instead. 40 | 41 | @return @c self, for chaining. 42 | */ 43 | - (id)appendValue:(id)value __attribute__((deprecated)); 44 | 45 | /** 46 | Appends a list of objects to the description. 47 | 48 | @return @c self, for chaining. 49 | */ 50 | - (id)appendList:(NSArray *)values 51 | start:(NSString *)start 52 | separator:(NSString *)separator 53 | end:(NSString *)end; 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCHasCount.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCHasCount.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Matches collections for which @c -count satisfies a given matcher. 14 | @ingroup collection_matchers 15 | */ 16 | @interface HCHasCount : HCBaseMatcher 17 | { 18 | id countMatcher; 19 | } 20 | 21 | + (id)hasCount:(id)matcher; 22 | - (id)initWithCount:(id)matcher; 23 | 24 | @end 25 | 26 | //-------------------------------------------------------------------------------------------------- 27 | 28 | /** 29 | Matches collections for which @c -count satisfies a given matcher. 30 | 31 | @b Synonym: @ref hasCount 32 | @see HCHasCount 33 | @ingroup collection_matchers 34 | */ 35 | OBJC_EXPORT id HC_hasCount(id matcher); 36 | 37 | /** 38 | hasCount(matcher) - 39 | Matches collections for which @c -count satisfies a given matcher. 40 | 41 | Synonym for @ref HC_hasCount, available if @c HC_SHORTHAND is defined. 42 | @see HCHasCount 43 | @ingroup collection_matchers 44 | */ 45 | #ifdef HC_SHORTHAND 46 | #define hasCount HC_hasCount 47 | #endif 48 | 49 | 50 | /** 51 | Matches collections for which @c -count equals a given count. 52 | 53 | @b Synonym: @ref hasCountOf 54 | @see HCHasCount 55 | @ingroup collection_matchers 56 | */ 57 | OBJC_EXPORT id HC_hasCountOf(NSUInteger count); 58 | 59 | /** 60 | hasCountOf(count) - 61 | Matches collections for which @c -count equals a given NSUInteger count. 62 | 63 | Synonym for @ref HC_hasCountOf, available if @c HC_SHORTHAND is defined. 64 | @see HCHasCount 65 | @ingroup collection_matchers 66 | */ 67 | #ifdef HC_SHORTHAND 68 | #define hasCountOf HC_hasCountOf 69 | #endif 70 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCHasDescription.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCHasDescription.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Does the object's @c -description satisfy a given matcher? 14 | @ingroup object_matchers 15 | */ 16 | @interface HCHasDescription : HCInvocationMatcher 17 | 18 | + (id)hasDescription:(id)descriptionMatcher; 19 | - (id)initWithDescription:(id)descriptionMatcher; 20 | 21 | @end 22 | 23 | 24 | /** 25 | Evaluates whether [item description] satisfies a given matcher. 26 | 27 | Examples: 28 | @li @ref hasDescription(@ref startsWith(\@"foo")) 29 | @li @ref hasDescription(\@"bar") 30 | 31 | @b Synonym: @ref hasDescription 32 | @param matcherOrValue A matcher, or a value for @ref equalTo matching. 33 | @see HCHasDescription 34 | @ingroup object_matchers 35 | */ 36 | OBJC_EXPORT id HC_hasDescription(id matcherOrValue); 37 | 38 | /** 39 | hasDescription(matcherOrValue) - 40 | Evaluates whether [item description] satisfies a given matcher. 41 | 42 | Examples: 43 | @li @ref hasDescription(@ref startsWith(\@"foo")) 44 | @li @ref hasDescription(\@"bar") 45 | 46 | Synonym for @ref HC_hasDescription, available if @c HC_SHORTHAND is defined. 47 | @param matcherOrValue A matcher, or a value for @ref equalTo matching. 48 | @see HCHasDescription 49 | @ingroup object_matchers 50 | */ 51 | #ifdef HC_SHORTHAND 52 | #define hasDescription(matcherOrValue) HC_hasDescription(matcherOrValue) 53 | #endif 54 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCInvocationMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCInvocationMatcher.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Supporting class for matching a feature of an object. 14 | 15 | Tests whether the result of passing a given invocation to the value satisfies a given matcher. 16 | 17 | @ingroup helpers 18 | */ 19 | @interface HCInvocationMatcher : HCBaseMatcher 20 | { 21 | NSInvocation *invocation; 22 | id subMatcher; 23 | BOOL shortMismatchDescription; 24 | } 25 | 26 | /** 27 | Determines whether a mismatch will be described in short form. 28 | 29 | Default is long form, which describes the object, the name of the invocation, and the 30 | sub-matcher's mismatch diagnosis. Short form only has the sub-matcher's mismatch diagnosis. 31 | */ 32 | @property(nonatomic, assign) BOOL shortMismatchDescription; 33 | 34 | /** 35 | Helper method for creating an invocation. 36 | 37 | A class is specified only so we can determine the method signature. 38 | */ 39 | + (NSInvocation *)invocationForSelector:(SEL)selector onClass:(Class)aClass; 40 | 41 | /** 42 | Helper method for creating an invocation. 43 | 44 | @b Deprecated: Use new name +invocationForSelector:onClass: 45 | */ 46 | + (NSInvocation *)createInvocationForSelector:(SEL)selector onClass:(Class)aClass __attribute__((deprecated)); 47 | 48 | /** 49 | Returns an HCInvocationMatcher object initialized with an invocation and a matcher. 50 | */ 51 | - (id)initWithInvocation:(NSInvocation *)anInvocation matching:(id)aMatcher; 52 | 53 | /** 54 | Invokes stored invocation on given item and returns the result. 55 | */ 56 | - (id)invokeOn:(id)item; 57 | 58 | /** 59 | Returns string representation of the invocation's selector. 60 | */ 61 | - (NSString *)stringFromSelector; 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCIs.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIs.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Decorates another HCMatcher, retaining the behavior but allowing tests to be slightly more 14 | expressive. 15 | 16 | For example: 17 | @code 18 | assertThat(cheese, equalTo(smelly)) 19 | @endcode 20 | vs. 21 | @code 22 | assertThat(cheese, is(equalTo(smelly))) 23 | @endcode 24 | 25 | @ingroup core_matchers 26 | */ 27 | @interface HCIs : HCBaseMatcher 28 | { 29 | id matcher; 30 | } 31 | 32 | + (id)is:(id)aMatcher; 33 | - (id)initWithMatcher:(id)aMatcher; 34 | 35 | @end 36 | 37 | 38 | /** 39 | Decorates another matcher, or provides a shortcut to the frequently used @ref is(equalTo(x)). 40 | 41 | If @a matcherOrValue is a matcher, its behavior is retained, but the test may be more expressive. 42 | 43 | If @a matcherOrValue is not a matcher, it is wrapped in an @ref equalTo matcher. This makes the 44 | following three statements the same: 45 | @code 46 | assertThat(cheese, equalTo(smelly)) 47 | assertThat(cheese, is(equalTo(smelly))) 48 | assertThat(cheese, is(smelly)) 49 | @endcode 50 | Choose the style that makes your expression most readable. This will vary depending on context. 51 | 52 | @b Synonym: @ref is 53 | @see HCIs 54 | @ingroup core_matchers 55 | */ 56 | OBJC_EXPORT id HC_is(id matcherOrValue); 57 | 58 | /** 59 | is(matcherOrValue) - 60 | Decorates another matcher, or provides a shortcut to the frequently used @ref is(equalTo(x)). 61 | 62 | If @a matcherOrValue is a matcher, its behavior is retained, but the test may be more expressive. 63 | 64 | If @a matcherOrValue is not a matcher, it is wrapped in an @ref equalTo matcher. This makes the 65 | following three statements the same: 66 | @code 67 | assertThat(cheese, equalTo(smelly)) 68 | assertThat(cheese, is(equalTo(smelly))) 69 | assertThat(cheese, is(smelly)) 70 | @endcode 71 | Choose the style that makes your expression most readable. This will vary depending on context. 72 | 73 | Synonym for @ref HC_is, available if @c HC_SHORTHAND is defined. 74 | @see HCIs 75 | @ingroup core_matchers 76 | */ 77 | #ifdef HC_SHORTHAND 78 | #define is HC_is 79 | #endif 80 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCIsAnything.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsAnything.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | A matcher that always returns @c YES. 14 | @ingroup core_matchers 15 | */ 16 | @interface HCIsAnything : HCBaseMatcher 17 | { 18 | NSString *description; 19 | } 20 | 21 | + (id)isAnything; 22 | + (id)isAnythingWithDescription:(NSString *)aDescription; 23 | 24 | - (id)init; 25 | - (id)initWithDescription:(NSString *)aDescription; 26 | 27 | @end 28 | 29 | //-------------------------------------------------------------------------------------------------- 30 | 31 | /** 32 | This matcher always evaluates to @c YES. 33 | 34 | @b Synonym: @ref anything 35 | @see HCIsAnything 36 | @ingroup core_matchers 37 | */ 38 | OBJC_EXPORT id HC_anything(); 39 | 40 | /** 41 | This matcher always evaluates to @c YES. 42 | 43 | Synonym for @ref HC_anything, available if @c HC_SHORTHAND is defined. 44 | @see HCIsAnything 45 | @ingroup core_matchers 46 | */ 47 | #ifdef HC_SHORTHAND 48 | #define anything() HC_anything() 49 | #endif 50 | 51 | 52 | /** 53 | This matcher always evaluates to @c YES. 54 | 55 | @b Synonym: @ref anythingWithDescription 56 | @param aDescription A meaningful string used when describing itself. 57 | @see HCIsAnything 58 | @ingroup core_matchers 59 | */ 60 | OBJC_EXPORT id HC_anythingWithDescription(NSString *aDescription); 61 | 62 | /** 63 | anythingWithDescription(description) - 64 | This matcher always evaluates to @c YES. 65 | 66 | Synonym for @ref HC_anythingWithDescription, available if @c HC_SHORTHAND is defined. 67 | @param aDescription A meaningful string used when describing itself. 68 | @see HCIsAnything 69 | @ingroup core_matchers 70 | */ 71 | #ifdef HC_SHORTHAND 72 | #define anythingWithDescription HC_anythingWithDescription 73 | #endif 74 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCIsCloseTo.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsCloseTo.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Is the argument a number close to a value, within some delta? 14 | @ingroup number_matchers 15 | */ 16 | @interface HCIsCloseTo : HCBaseMatcher 17 | { 18 | double value; 19 | double delta; 20 | } 21 | 22 | + (id)isCloseTo:(double)aValue within:(double)aDelta; 23 | - (id)initWithValue:(double)aValue delta:(double)aDelta; 24 | 25 | @end 26 | 27 | //-------------------------------------------------------------------------------------------------- 28 | 29 | /** 30 | Is the argument a number close to a value, within some delta? 31 | 32 | @b Synonym: @ref closeTo 33 | @see HCIsCloseTo 34 | @ingroup number_matchers 35 | */ 36 | OBJC_EXPORT id HC_closeTo(double aValue, double aDelta); 37 | 38 | /** 39 | closeTo(value, delta) - 40 | Is the argument a number close to a value, within some delta? 41 | 42 | Synonym for @ref HC_closeTo, available if @c HC_SHORTHAND is defined. 43 | @see HCIsCloseTo 44 | @ingroup number_matchers 45 | */ 46 | #ifdef HC_SHORTHAND 47 | #define closeTo HC_closeTo 48 | #endif 49 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCIsCollectionContaining.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsCollectionContaining.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Matches a collection if any element satisfies a given matcher. 14 | @ingroup collection_matchers 15 | */ 16 | @interface HCIsCollectionContaining : HCBaseMatcher 17 | { 18 | id elementMatcher; 19 | } 20 | 21 | + (id)isCollectionContaining:(id)anElementMatcher; 22 | - (id)initWithMatcher:(id)anElementMatcher; 23 | 24 | @end 25 | 26 | //-------------------------------------------------------------------------------------------------- 27 | 28 | /** 29 | Matches a collection if any element satifies a given matcher. 30 | 31 | @b Synonym: @ref hasItem 32 | @param matcherOrValue A matcher, or a value for @ref equalTo matching. 33 | @see HCIsCollectionContaining 34 | @ingroup collection_matchers 35 | */ 36 | OBJC_EXPORT id HC_hasItem(id matcherOrValue); 37 | 38 | /** 39 | hasItem(matcherOrValue) - 40 | Matches a collection if any element satifies a given matcher. 41 | 42 | Synonym for @ref HC_hasItem, available if @c HC_SHORTHAND is defined. 43 | @param matcherOrValue A matcher, or a value for @ref equalTo matching. 44 | @see HCIsCollectionContaining 45 | @ingroup collection_matchers 46 | */ 47 | #ifdef HC_SHORTHAND 48 | #define hasItem HC_hasItem 49 | #endif 50 | 51 | 52 | /** 53 | Matches a collection if all matchers are satisfied by any of the collection's elements. 54 | 55 | @b Synonym: @ref hasItems 56 | @param matcherOrValue1 Comma-separated list of matchers - or values for @ref equalTo matching - ending with @c nil. 57 | @see HCIsCollectionContaining 58 | @ingroup collection_matchers 59 | */ 60 | OBJC_EXPORT id HC_hasItems(id matcherOrValue1, ...); 61 | 62 | /** 63 | hasItems(matcherOrValue1, ...) - 64 | Matches a collection if all matchers are satisfied by any of the collection's elements. 65 | 66 | Synonym for @ref HC_hasItems, available if @c HC_SHORTHAND is defined. 67 | @param matcherOrValue1 Comma-separated list of matchers - or values for @ref equalTo matching - ending with @c nil. 68 | @see HCIsCollectionContaining 69 | @ingroup collection_matchers 70 | */ 71 | #ifdef HC_SHORTHAND 72 | #define hasItems HC_hasItems 73 | #endif 74 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCIsCollectionContainingInAnyOrder.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsCollectionContainingInAnyOrder.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Matches a collection if its elements, in any order, satisfy a list of matchers. 14 | @ingroup collection_matchers 15 | */ 16 | @interface HCIsCollectionContainingInAnyOrder : HCBaseMatcher 17 | { 18 | NSMutableArray *matchers; 19 | } 20 | 21 | + (id)isCollectionContainingInAnyOrder:(NSMutableArray *)itemMatchers; 22 | - (id)initWithMatchers:(NSMutableArray *)itemMatchers; 23 | 24 | @end 25 | 26 | //-------------------------------------------------------------------------------------------------- 27 | 28 | /** 29 | Matches a collection if its elements, in any order, satisfy a list of matchers. 30 | 31 | @b Synonym: @ref containsInAnyOrder 32 | @param itemMatcher1 Comma-separated list of matchers - or values for @ref equalTo matching - ending with @c nil. 33 | @see HCIsCollectionContainingInAnyOrder 34 | @ingroup collection_matchers 35 | */ 36 | OBJC_EXPORT id HC_containsInAnyOrder(id itemMatcher1, ...); 37 | 38 | /** 39 | containsInAnyOrder(itemMatcher1, ...) - 40 | Matches a collection if its elements, in any order, satisfy a list of matchers. 41 | 42 | Synonym for @ref HC_containsInAnyOrder, available if @c HC_SHORTHAND is defined. 43 | @param itemMatcher1 Comma-separated list of matchers - or values for @ref equalTo matching - ending with @c nil. 44 | @see HCIsCollectionContainingInAnyOrder 45 | @ingroup collection_matchers 46 | */ 47 | #ifdef HC_SHORTHAND 48 | #define containsInAnyOrder HC_containsInAnyOrder 49 | #endif 50 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCIsCollectionContainingInOrder.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsCollectionContainingInOrder.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Matches a collection if its elements, in order, satisfy a list of matchers. 14 | @ingroup collection_matchers 15 | */ 16 | @interface HCIsCollectionContainingInOrder : HCBaseMatcher 17 | { 18 | NSArray *matchers; 19 | } 20 | 21 | + (id)isCollectionContainingInOrder:(NSArray *)itemMatchers; 22 | - (id)initWithMatchers:(NSArray *)itemMatchers; 23 | 24 | @end 25 | 26 | //-------------------------------------------------------------------------------------------------- 27 | 28 | /** 29 | Matches a collection if its elements, in order, satisfy a list of matchers. 30 | 31 | @b Synonym: @ref contains 32 | @param itemMatcher1 Comma-separated list of matchers - or values for @ref equalTo matching - ending with @c nil. 33 | @see HCIsCollectionContainingInOrder 34 | @ingroup collection_matchers 35 | */ 36 | OBJC_EXPORT id HC_contains(id itemMatcher1, ...); 37 | 38 | /** 39 | contains(itemMatcher1, ...) 40 | matches a collection if its elements, in order, satisfy a list of matchers. 41 | 42 | Synonym for @ref HC_contains, available if @c HC_SHORTHAND is defined. 43 | @param itemMatcher1 Comma-separated list of matchers - or values for @ref equalTo matching - ending with @c nil. 44 | @see HCIsCollectionContainingInOrder 45 | @ingroup collection_matchers 46 | */ 47 | #ifdef HC_SHORTHAND 48 | #define contains HC_contains 49 | #endif 50 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCIsCollectionOnlyContaining.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsCollectionOnlyContaining.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Matches collections that only contain elements satisfying a given matcher. 14 | 15 | This matcher will never match an empty collection. 16 | 17 | @ingroup collection_matchers 18 | */ 19 | @interface HCIsCollectionOnlyContaining : HCBaseMatcher 20 | { 21 | id matcher; 22 | } 23 | 24 | + (id)isCollectionOnlyContaining:(id)aMatcher; 25 | - (id)initWithMatcher:(id)aMatcher; 26 | 27 | @end 28 | 29 | //-------------------------------------------------------------------------------------------------- 30 | 31 | /** 32 | Matches collections that only contain elements satisfying any of a list of matchers. 33 | 34 | For example, 35 | [NSArray arrayWithObjects:@"c", "a", @"b", nil] 36 | would satisfy 37 | onlyContains(lessThan(@"d"), nil). 38 | 39 | If a @a items is not a matcher, it is equivalent to equalTo(x), so the array in the example 40 | above would also satisfy 41 | onlyContains(@"a", @"b", @"c", nil). 42 | 43 | @b Synonym: @ref onlyContains 44 | @param itemMatcher1 Comma-separated list of matchers - or values for @ref equalTo matching - ending with @c nil. 45 | @see HCIsCollectionOnlyContaining 46 | @ingroup collection_matchers 47 | */ 48 | OBJC_EXPORT id HC_onlyContains(id itemMatcher1, ...); 49 | 50 | /** 51 | onlyContains(itemMatcher1, ...) 52 | matches collections that only contain elements satisfying any of a list of matchers. 53 | 54 | For example, 55 | [NSArray arrayWithObjects:@"c", "a", @"b", nil] 56 | would satisfy 57 | onlyContains(lessThan(@"d"), nil). 58 | 59 | If a @a items is not a matcher, it is equivalent to equalTo(x), so the array in the example 60 | above would also satisfy 61 | onlyContains(@"a", @"b", @"c", nil). 62 | 63 | Synonym for @ref HC_onlyContains, available if @c HC_SHORTHAND is defined. 64 | @param itemMatcher1 Comma-separated list of matchers - or values for @ref equalTo matching - ending with @c nil. 65 | @see HCIsCollectionOnlyContaining 66 | @ingroup collection_matchers 67 | */ 68 | #ifdef HC_SHORTHAND 69 | #define onlyContains HC_onlyContains 70 | #endif 71 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCIsDictionaryContaining.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsDictionaryContaining.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Matches dictionaries containing a key-value pair satisfying a given pair of matchers. 14 | @ingroup collection_matchers 15 | */ 16 | @interface HCIsDictionaryContaining : HCBaseMatcher 17 | { 18 | id keyMatcher; 19 | id valueMatcher; 20 | } 21 | 22 | + (id)isDictionaryContainingKey:(id)aKeyMatcher 23 | value:(id)aValueMatcher; 24 | 25 | - (id)initWithKeyMatcher:(id)aKeyMatcher 26 | valueMatcher:(id)aValueMatcher; 27 | 28 | @end 29 | 30 | //-------------------------------------------------------------------------------------------------- 31 | 32 | /** 33 | Matches dictionaries containing a key-value pair satisfying a given pair of matchers. 34 | 35 | @b Synonym: @ref hasEntry 36 | @param keyMatcher A matcher - or a value for @ref equalTo matching - for the key. 37 | @param valueMatcher A matcher - or a value for @ref equalTo matching - for the value. 38 | @see HCIsDictionaryContaining 39 | @ingroup collection_matchers 40 | */ 41 | OBJC_EXPORT id HC_hasEntry(id keyMatcher, id valueMatcher); 42 | 43 | /** 44 | hasEntry(keyMatcher, valueMatcher) - 45 | Matches dictionaries containing a key-value pair satisfying a given pair of matchers. 46 | 47 | Synonym for @ref HC_hasEntry, available if @c HC_SHORTHAND is defined. 48 | @param keyMatcher A matcher - or a value for @ref equalTo matching - for the key. 49 | @param valueMatcher A matcher - or a value for @ref equalTo matching - for the value. 50 | @see HCIsDictionaryContaining 51 | @ingroup collection_matchers 52 | */ 53 | #ifdef HC_SHORTHAND 54 | #define hasEntry HC_hasEntry 55 | #endif 56 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCIsDictionaryContainingEntries.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsDictionaryContainingEntries.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Matches dictionaries containing key-value pairs satisfying given lists of keys and value 14 | matchers. 15 | 16 | @ingroup collection_matchers 17 | */ 18 | @interface HCIsDictionaryContainingEntries : HCBaseMatcher 19 | { 20 | NSArray *keys; 21 | NSArray *valueMatchers; 22 | } 23 | 24 | + (id)isDictionaryContainingKeys:(NSArray *)theKeys 25 | valueMatchers:(NSArray *)theValueMatchers; 26 | 27 | - (id)initWithKeys:(NSArray *)theKeys 28 | valueMatchers:(NSArray *)theValueMatchers; 29 | 30 | @end 31 | 32 | //-------------------------------------------------------------------------------------------------- 33 | 34 | /** 35 | Matches dictionaries containing key-value pairs satisfying a given lists of alternating keys and 36 | value matchers. 37 | 38 | @b Synonym: @ref hasEntries 39 | @param keysAndValueMatchers Alternating pairs of keys and value matchers - or straight values for @ref equalTo matching. 40 | @see HCIsDictionaryContainingEntries 41 | @ingroup collection_matchers 42 | */ 43 | OBJC_EXPORT id HC_hasEntries(id keysAndValueMatchers, ...); 44 | 45 | /** 46 | HC_hasEntries(id keysAndValueMatchers, ...) - 47 | Matches dictionaries containing key-value pairs satisfying a given lists of alternating keys and 48 | value matchers. 49 | 50 | Synonym for @ref HC_hasEntries, available if @c HC_SHORTHAND is defined. 51 | @param keysAndValueMatchers Alternating pairs of keys and value matchers - or straight values for @ref equalTo matching. 52 | @see HCIsDictionaryContainingEntries 53 | @ingroup collection_matchers 54 | */ 55 | #ifdef HC_SHORTHAND 56 | #define hasEntries HC_hasEntries 57 | #endif 58 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCIsDictionaryContainingKey.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsDictionaryContainingKey.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Matches dictionaries containing a key satisfying a given matcher. 14 | @ingroup collection_matchers 15 | */ 16 | @interface HCIsDictionaryContainingKey : HCBaseMatcher 17 | { 18 | id keyMatcher; 19 | } 20 | 21 | + (id)isDictionaryContainingKey:(id)theKeyMatcher; 22 | - (id)initWithKeyMatcher:(id)theKeyMatcher; 23 | 24 | @end 25 | 26 | //-------------------------------------------------------------------------------------------------- 27 | 28 | /** 29 | Matches dictionaries containing a key satisfying a given matcher. 30 | 31 | @b Synonym: @ref hasKey 32 | @param matcherOrValue A matcher, or a value for @ref equalTo matching. 33 | @see HCIsDictionaryContainingKey 34 | @ingroup collection_matchers 35 | */ 36 | OBJC_EXPORT id HC_hasKey(id matcherOrValue); 37 | 38 | /** 39 | hasKey(matcherOrValue) - 40 | Matches dictionaries containing a key satisfying a given matcher. 41 | 42 | Synonym for @ref HC_hasKey, available if @c HC_SHORTHAND is defined. 43 | @param matcherOrValue A matcher, or a value for @ref equalTo matching. 44 | @see HCIsDictionaryContainingKey 45 | @ingroup collection_matchers 46 | */ 47 | #ifdef HC_SHORTHAND 48 | #define hasKey HC_hasKey 49 | #endif 50 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCIsDictionaryContainingValue.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsDictionaryContainingValue.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Matches dictionaries containing a value satisfying a given matcher. 14 | @ingroup collection_matchers 15 | */ 16 | @interface HCIsDictionaryContainingValue : HCBaseMatcher 17 | { 18 | id valueMatcher; 19 | } 20 | 21 | + (id)isDictionaryContainingValue:(id)theValueMatcher; 22 | - (id)initWithValueMatcher:(id)theValueMatcher; 23 | 24 | @end 25 | 26 | //-------------------------------------------------------------------------------------------------- 27 | 28 | /** 29 | Matches dictionaries containing a value satisfying a given matcher. 30 | 31 | @b Synonym: @ref hasValue 32 | @param matcherOrValue A matcher, or a value for @ref equalTo matching. 33 | @see HCIsDictionaryContainingValue 34 | @ingroup collection_matchers 35 | */ 36 | OBJC_EXPORT id HC_hasValue(id matcherOrValue); 37 | 38 | /** 39 | hasValue(matcherOrValue) - 40 | Matches dictionaries containing a value satisfying a given matcher. 41 | 42 | Synonym for @ref HC_hasValue, available if @c HC_SHORTHAND is defined. 43 | @param matcherOrValue A matcher, or a value for @ref equalTo matching. 44 | @see HCIsDictionaryContainingValue 45 | @ingroup collection_matchers 46 | */ 47 | #ifdef HC_SHORTHAND 48 | #define hasValue HC_hasValue 49 | #endif 50 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCIsEmptyCollection.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsEmptyCollection.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Matches empty collection. 14 | @ingroup collection_matchers 15 | */ 16 | @interface HCIsEmptyCollection : HCHasCount 17 | 18 | + (id)isEmptyCollection; 19 | - (id)init; 20 | 21 | @end 22 | 23 | //-------------------------------------------------------------------------------------------------- 24 | 25 | /** 26 | Matches empty collection. 27 | 28 | @b Synonym: @ref empty 29 | @see HCIsEmptyCollection 30 | @ingroup collection_matchers 31 | */ 32 | OBJC_EXPORT id HC_empty(); 33 | 34 | /** 35 | Matches empty collection. 36 | 37 | Synonym for @ref HC_empty, available if @c HC_SHORTHAND is defined. 38 | @see HCIsEmptyCollection 39 | @ingroup collection_matchers 40 | */ 41 | #ifdef HC_SHORTHAND 42 | #define empty() HC_empty() 43 | #endif 44 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCIsEqual.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsEqual.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Is the object equal to another object, as tested by the @c -isEqual: method? 14 | 15 | If the given object is @c nil, the matcher will match @c nil. 16 | 17 | @ingroup core_matchers 18 | */ 19 | @interface HCIsEqual : HCBaseMatcher 20 | { 21 | id object; 22 | } 23 | 24 | + (id)isEqualTo:(id)anObject; 25 | - (id)initEqualTo:(id)anObject; 26 | 27 | @end 28 | 29 | //-------------------------------------------------------------------------------------------------- 30 | 31 | /** 32 | Is the object equal to another object, as tested by the @c -isEqual: method? 33 | 34 | If the given object is @c nil, the matcher will match @c nil. 35 | 36 | @b Synonym: @ref equalTo 37 | @see HCIsEqual 38 | @ingroup core_matchers 39 | */ 40 | OBJC_EXPORT id HC_equalTo(id object); 41 | 42 | /** 43 | equalTo(object) - 44 | Is the object equal to another object, as tested by the @c -isEqual: method? 45 | 46 | If the given object is @c nil, the matcher will match @c nil. 47 | 48 | Synonym for @ref HC_equalTo, available if @c HC_SHORTHAND is defined. 49 | @see HCIsEqual 50 | @ingroup core_matchers 51 | */ 52 | #ifdef HC_SHORTHAND 53 | #define equalTo HC_equalTo 54 | #endif 55 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCIsEqualIgnoringCase.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsEqualIgnoringCase.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Tests if a string is equal to another string, regardless of the case. 14 | @ingroup text_matchers 15 | */ 16 | @interface HCIsEqualIgnoringCase : HCBaseMatcher 17 | { 18 | NSString *string; 19 | } 20 | 21 | + (id)isEqualIgnoringCase:(NSString *)aString; 22 | - (id)initWithString:(NSString *)aString; 23 | 24 | @end 25 | 26 | //-------------------------------------------------------------------------------------------------- 27 | 28 | /** 29 | Tests if a string is equal to another string, regardless of the case. 30 | 31 | @b Synonym: @ref equalToIgnoringCase 32 | @see HCIsEqualIgnoringCase 33 | @ingroup text_matchers 34 | */ 35 | OBJC_EXPORT id HC_equalToIgnoringCase(NSString *string); 36 | 37 | /** 38 | equalToIgnoringCase(string) - 39 | Tests if a string is equal to another string, regardless of the case. 40 | 41 | Synonym for @ref HC_equalToIgnoringCase, available if @c HC_SHORTHAND is defined. 42 | @see HCIsEqualIgnoringCase 43 | @ingroup text_matchers 44 | */ 45 | #ifdef HC_SHORTHAND 46 | #define equalToIgnoringCase HC_equalToIgnoringCase 47 | #endif 48 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCIsEqualIgnoringWhiteSpace.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsEqualIgnoringWhiteSpace.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Tests if a string is equal to another string, ignoring any changes in whitespace. 14 | @ingroup text_matchers 15 | */ 16 | @interface HCIsEqualIgnoringWhiteSpace : HCBaseMatcher 17 | { 18 | NSString *originalString; 19 | NSString *strippedString; 20 | } 21 | 22 | + (id)isEqualIgnoringWhiteSpace:(NSString *)aString; 23 | - (id)initWithString:(NSString *)aString; 24 | 25 | @end 26 | 27 | //-------------------------------------------------------------------------------------------------- 28 | 29 | /** 30 | Tests if a string is equal to another string, ignoring any changes in whitespace. 31 | 32 | @b Synonym: @ref equalToIgnoringWhiteSpace 33 | @see HCIsEqualIgnoringWhiteSpace 34 | @ingroup text_matchers 35 | */ 36 | OBJC_EXPORT id HC_equalToIgnoringWhiteSpace(NSString *string); 37 | 38 | /** 39 | equalToIgnoringWhiteSpace(string) - 40 | Tests if a string is equal to another string, ignoring any changes in whitespace. 41 | 42 | Synonym for @ref HC_equalToIgnoringWhiteSpace, available if @c HC_SHORTHAND is defined. 43 | @see HCIsEqualIgnoringWhiteSpace 44 | @ingroup text_matchers 45 | */ 46 | #ifdef HC_SHORTHAND 47 | #define equalToIgnoringWhiteSpace HC_equalToIgnoringWhiteSpace 48 | #endif 49 | 50 | 51 | /** @} */ 52 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCIsEqualToNumber.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsEqualToNumber.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Is the @c BOOL value, converted to an @c NSNumber, equal to another object? 14 | 15 | @b Synonym: @ref equalToBool 16 | @ingroup primitive_number_matchers 17 | */ 18 | OBJC_EXPORT id HC_equalToBool(BOOL value); 19 | 20 | /** 21 | equalToBool(value) - 22 | Is the @c BOOL value, converted to an @c NSNumber, equal to another object? 23 | 24 | Synonym for @ref HC_equalToBool, available if @c HC_SHORTHAND is defined. 25 | @ingroup primitive_number_matchers 26 | */ 27 | #ifdef HC_SHORTHAND 28 | #define equalToBool HC_equalToBool 29 | #endif 30 | 31 | 32 | /** 33 | Is the @c char value, converted to an @c NSNumber, equal to another object? 34 | 35 | @b Synonym: @ref equalToChar 36 | @ingroup primitive_number_matchers 37 | */ 38 | OBJC_EXPORT id HC_equalToChar(char value); 39 | 40 | /** 41 | equalToChar(value) - 42 | Is the @c char value, converted to an @c NSNumber, equal to another object? 43 | 44 | Synonym for @ref HC_equalToChar, available if @c HC_SHORTHAND is defined. 45 | @ingroup primitive_number_matchers 46 | */ 47 | #ifdef HC_SHORTHAND 48 | #define equalToChar HC_equalToChar 49 | #endif 50 | 51 | 52 | /** 53 | Is the @c double value, converted to an @c NSNumber, equal to another object? 54 | 55 | @b Synonym: @ref equalToDouble 56 | @ingroup primitive_number_matchers 57 | */ 58 | OBJC_EXPORT id HC_equalToDouble(double value); 59 | 60 | /** 61 | equalToDouble(value) - 62 | Is the @c double value, converted to an @c NSNumber, equal to another object? 63 | 64 | Synonym for @ref HC_equalToDouble, available if @c HC_SHORTHAND is defined. 65 | @ingroup primitive_number_matchers 66 | */ 67 | #ifdef HC_SHORTHAND 68 | #define equalToDouble HC_equalToDouble 69 | #endif 70 | 71 | /** 72 | Is the @c float value, converted to an @c NSNumber, equal to another object? 73 | 74 | @b Synonym: @ref equalToFloat 75 | @ingroup primitive_number_matchers 76 | */ 77 | OBJC_EXPORT id HC_equalToFloat(float value); 78 | 79 | /** 80 | equalToFloat(value) - 81 | Is the @c float value, converted to an @c NSNumber, equal to another object? 82 | 83 | Synonym for @ref HC_equalToFloat, available if @c HC_SHORTHAND is defined. 84 | @ingroup primitive_number_matchers 85 | */ 86 | #ifdef HC_SHORTHAND 87 | #define equalToFloat HC_equalToFloat 88 | #endif 89 | 90 | 91 | /** 92 | Is the @c int value, converted to an @c NSNumber, equal to another object? 93 | 94 | @b Synonym: @ref equalToInt 95 | @ingroup primitive_number_matchers 96 | */ 97 | OBJC_EXPORT id HC_equalToInt(int value); 98 | 99 | /** 100 | equalToInt(value) - 101 | Is the @c int value, converted to an @c NSNumber, equal to another object? 102 | 103 | Synonym for @ref HC_equalToInt, available if @c HC_SHORTHAND is defined. 104 | @ingroup primitive_number_matchers 105 | */ 106 | #ifdef HC_SHORTHAND 107 | #define equalToInt HC_equalToInt 108 | #endif 109 | 110 | 111 | /** 112 | Is the @c long value, converted to an @c NSNumber, equal to another object? 113 | 114 | @b Synonym: @ref equalToLong 115 | @ingroup primitive_number_matchers 116 | */ 117 | OBJC_EXPORT id HC_equalToLong(long value); 118 | 119 | /** 120 | equalToLong(value) - 121 | Is the @c long value, converted to an @c NSNumber, equal to another object? 122 | 123 | Synonym for @ref HC_equalToLong, available if @c HC_SHORTHAND is defined. 124 | @ingroup primitive_number_matchers 125 | */ 126 | #ifdef HC_SHORTHAND 127 | #define equalToLong HC_equalToLong 128 | #endif 129 | 130 | 131 | /** 132 | Is the long long value, converted to an @c NSNumber, equal to another object? 133 | 134 | @b Synonym: @ref equalToLongLong 135 | @ingroup primitive_number_matchers 136 | */ 137 | OBJC_EXPORT id HC_equalToLongLong(long long value); 138 | 139 | /** 140 | equalToLongLong(value) - 141 | Is the long long value, converted to an @c NSNumber, equal to another object? 142 | 143 | Synonym for @ref HC_equalToLongLong, available if @c HC_SHORTHAND is defined. 144 | @ingroup primitive_number_matchers 145 | */ 146 | #ifdef HC_SHORTHAND 147 | #define equalToLongLong HC_equalToLongLong 148 | #endif 149 | 150 | 151 | /** 152 | Is the @c short value, converted to an @c NSNumber, equal to another object? 153 | 154 | @b Synonym: @ref equalToShort 155 | @ingroup primitive_number_matchers 156 | */ 157 | OBJC_EXPORT id HC_equalToShort(short value); 158 | 159 | /** 160 | equalToShort(value) - 161 | Is the @c short value, converted to an @c NSNumber, equal to another object? 162 | 163 | Synonym for @ref HC_equalToShort, available if @c HC_SHORTHAND is defined. 164 | @ingroup primitive_number_matchers 165 | */ 166 | #ifdef HC_SHORTHAND 167 | #define equalToShort HC_equalToShort 168 | #endif 169 | 170 | 171 | /** 172 | Is the unsigned char value, converted to an @c NSNumber, equal to another object? 173 | 174 | @b Synonym: @ref equalToUnsignedChar 175 | @ingroup primitive_number_matchers 176 | */ 177 | OBJC_EXPORT id HC_equalToUnsignedChar(unsigned char value); 178 | 179 | /** 180 | equalToUnsignedChar(value) - 181 | Is the unsigned char value, converted to an @c NSNumber, equal to another object? 182 | 183 | Synonym for @ref HC_equalToUnsignedChar, available if @c HC_SHORTHAND is defined. 184 | @ingroup primitive_number_matchers 185 | */ 186 | #ifdef HC_SHORTHAND 187 | #define equalToUnsignedChar HC_equalToUnsignedChar 188 | #endif 189 | 190 | 191 | /** 192 | Is the unsigned int value, converted to an @c NSNumber, equal to another object? 193 | 194 | @b Synonym: @ref equalToUnsignedInt 195 | @ingroup primitive_number_matchers 196 | */ 197 | OBJC_EXPORT id HC_equalToUnsignedInt(unsigned int value); 198 | 199 | /** 200 | equalToUnsignedInt(value) - 201 | Is the unsigned int value, converted to an @c NSNumber, equal to another object? 202 | 203 | Synonym for @ref HC_equalToUnsignedInt, available if @c HC_SHORTHAND is defined. 204 | @ingroup primitive_number_matchers 205 | */ 206 | #ifdef HC_SHORTHAND 207 | #define equalToUnsignedInt HC_equalToUnsignedInt 208 | #endif 209 | 210 | 211 | /** 212 | Is the unsigned long value, converted to an @c NSNumber, equal to another object? 213 | 214 | @b Synonym: @ref equalToUnsignedLong 215 | @ingroup primitive_number_matchers 216 | */ 217 | OBJC_EXPORT id HC_equalToUnsignedLong(unsigned long value); 218 | 219 | /** 220 | equalToUnsignedLong(value) - 221 | Is the unsigned long value, converted to an @c NSNumber, equal to another object? 222 | 223 | Synonym for @ref HC_equalToUnsignedLong, available if @c HC_SHORTHAND is defined. 224 | @ingroup primitive_number_matchers 225 | */ 226 | #ifdef HC_SHORTHAND 227 | #define equalToUnsignedLong HC_equalToUnsignedLong 228 | #endif 229 | 230 | 231 | /** 232 | Is the unsigned long long value, converted to an @c NSNumber, equal to another object? 233 | 234 | @b Synonym: @ref equalToUnsignedLongLong 235 | @ingroup primitive_number_matchers 236 | */ 237 | OBJC_EXPORT id HC_equalToUnsignedLongLong(unsigned long long value); 238 | 239 | /** 240 | equalToUnsignedLongLong(value) - 241 | Is the unsigned long long value, converted to an @c NSNumber, equal to another object? 242 | 243 | Synonym for @ref HC_equalToUnsignedLongLong, available if @c HC_SHORTHAND is defined. 244 | @ingroup primitive_number_matchers 245 | */ 246 | #ifdef HC_SHORTHAND 247 | #define equalToUnsignedLongLong HC_equalToUnsignedLongLong 248 | #endif 249 | 250 | 251 | /** 252 | Is the unsigned short value, converted to an @c NSNumber, equal to another object? 253 | 254 | @b Synonym: @ref equalToUnsignedShort 255 | @ingroup primitive_number_matchers 256 | */ 257 | OBJC_EXPORT id HC_equalToUnsignedShort(unsigned short value); 258 | 259 | /** 260 | equalToUnsignedShort(value) - 261 | Is the unsigned short value, converted to an @c NSNumber, equal to another object? 262 | 263 | Synonym for @ref HC_equalToUnsignedShort, available if @c HC_SHORTHAND is defined. 264 | @ingroup primitive_number_matchers 265 | */ 266 | #ifdef HC_SHORTHAND 267 | #define equalToUnsignedShort HC_equalToUnsignedShort 268 | #endif 269 | 270 | 271 | /** 272 | Is the @c NSInteger value, converted to an @c NSNumber, equal to another object? 273 | 274 | @b Synonym: @ref equalToInteger 275 | @ingroup primitive_number_matchers 276 | */ 277 | OBJC_EXPORT id HC_equalToInteger(NSInteger value); 278 | 279 | /** 280 | equalToInteger(value) - 281 | Is the @c NSInteger value, converted to an @c NSNumber, equal to another object? 282 | 283 | Synonym for @ref HC_equalToInteger, available if @c HC_SHORTHAND is defined. 284 | @ingroup primitive_number_matchers 285 | */ 286 | #ifdef HC_SHORTHAND 287 | #define equalToInteger HC_equalToInteger 288 | #endif 289 | 290 | 291 | /** 292 | Is the @c NSUInteger value, converted to an @c NSNumber, equal to another object? 293 | 294 | @b Synonym: @ref equalToUnsignedInteger 295 | @ingroup primitive_number_matchers 296 | */ 297 | OBJC_EXPORT id HC_equalToUnsignedInteger(NSUInteger value); 298 | 299 | /** 300 | equalToUnsignedInteger(value) - 301 | Is the @c NSUInteger value, converted to an @c NSNumber, equal to another object? 302 | 303 | Synonym for @ref HC_equalToUnsignedInteger, available if @c HC_SHORTHAND is defined. 304 | @ingroup primitive_number_matchers 305 | */ 306 | #ifdef HC_SHORTHAND 307 | #define equalToUnsignedInteger HC_equalToUnsignedInteger 308 | #endif 309 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCIsIn.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsIn.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Is the object present in the given collection? 14 | @ingroup collection_matchers 15 | */ 16 | @interface HCIsIn : HCBaseMatcher 17 | { 18 | id collection; 19 | } 20 | 21 | + (id)isInCollection:(id)aCollection; 22 | - (id)initWithCollection:(id)aCollection; 23 | 24 | @end 25 | 26 | //-------------------------------------------------------------------------------------------------- 27 | 28 | /** 29 | Is the object present in the given collection? 30 | 31 | @b Synonym: @ref isIn 32 | @see HCIsIn 33 | @ingroup collection_matchers 34 | */ 35 | OBJC_EXPORT id HC_isIn(id aCollection); 36 | 37 | /** 38 | isIn(collection) - 39 | Is the object present in the given collection? 40 | 41 | Synonym for @ref HC_isIn, available if @c HC_SHORTHAND is defined. 42 | @see HCIsIn 43 | @ingroup collection_matchers 44 | */ 45 | #ifdef HC_SHORTHAND 46 | #define isIn HC_isIn 47 | #endif 48 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCIsInstanceOf.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsInstanceOf.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Tests whether the value is an instance of a class (including subclasses). 14 | @ingroup core_matchers 15 | */ 16 | @interface HCIsInstanceOf : HCBaseMatcher 17 | { 18 | Class theClass; 19 | } 20 | 21 | + (id)isInstanceOf:(Class)type; 22 | - (id)initWithType:(Class)type; 23 | 24 | @end 25 | 26 | //-------------------------------------------------------------------------------------------------- 27 | 28 | /** 29 | Is the value an instance of a particular type? 30 | 31 | @b Synonym: @ref instanceOf 32 | @see HCIsInstanceOf 33 | @ingroup core_matchers 34 | */ 35 | OBJC_EXPORT id HC_instanceOf(Class type); 36 | 37 | /** 38 | instanceOf(type) - 39 | Is the value an instance of a particular type? 40 | 41 | Synonym for @ref HC_instanceOf, available if @c HC_SHORTHAND is defined. 42 | @see HCIsInstanceOf 43 | @ingroup core_matchers 44 | */ 45 | #ifdef HC_SHORTHAND 46 | #define instanceOf HC_instanceOf 47 | #endif 48 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCIsNil.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsNil.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Is the value @c nil? 14 | @ingroup core_matchers 15 | */ 16 | @interface HCIsNil : HCBaseMatcher 17 | 18 | + (id)isNil; 19 | 20 | @end 21 | 22 | //-------------------------------------------------------------------------------------------------- 23 | 24 | /** 25 | Matches if the value is @c nil. 26 | 27 | @b Synonym: @ref nilValue 28 | @see HCIsNil 29 | @ingroup core_matchers 30 | */ 31 | OBJC_EXPORT id HC_nilValue(); 32 | 33 | /** 34 | Matches if the value is @c nil. 35 | 36 | Synonym for @ref HC_nilValue, available if @c HC_SHORTHAND is defined. 37 | @see HCIsNil 38 | @ingroup core_matchers 39 | */ 40 | #ifdef HC_SHORTHAND 41 | #define nilValue() HC_nilValue() 42 | #endif 43 | 44 | 45 | /** 46 | Matches if the value is not @c nil. 47 | 48 | @b Synonym: @ref notNilValue 49 | @see HCIsNil 50 | @see HCIsNot 51 | @ingroup core_matchers 52 | */ 53 | OBJC_EXPORT id HC_notNilValue(); 54 | 55 | /** 56 | Matches if the value is not @c nil. 57 | 58 | Synonym for @ref HC_notNilValue, available if @c HC_SHORTHAND is defined. 59 | @see HCIsNil 60 | @see HCIsNot 61 | @ingroup core_matchers 62 | */ 63 | #ifdef HC_SHORTHAND 64 | #define notNilValue() HC_notNilValue() 65 | #endif 66 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCIsNot.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsNot.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Calculates the logical negation of a matcher. 14 | @ingroup core_matchers 15 | */ 16 | @interface HCIsNot : HCBaseMatcher 17 | { 18 | id matcher; 19 | } 20 | 21 | + (id)isNot:(id)aMatcher; 22 | - (id)initNot:(id)aMatcher; 23 | 24 | @end 25 | 26 | //-------------------------------------------------------------------------------------------------- 27 | 28 | /** 29 | Inverts the rule, or provides a shortcut to the frequently used isNot(equalTo(x)). 30 | 31 | For example: 32 | @code 33 | assertThat(cheese, isNot(equalTo(smelly))) 34 | @endcode 35 | vs. 36 | @code 37 | assertThat(cheese, isNot(smelly)) 38 | @endcode 39 | 40 | @b Synonym: @ref isNot 41 | @see HCIsNot 42 | @ingroup core_matchers 43 | */ 44 | OBJC_EXPORT id HC_isNot(id matcherOrValue); 45 | 46 | /** 47 | isNot(matcherOrValue) - 48 | Inverts the rule, or provides a shortcut to the frequently used isNot(equalTo(x)). 49 | 50 | For example: 51 | @code 52 | assertThat(cheese, isNot(equalTo(smelly))) 53 | @endcode 54 | vs. 55 | @code 56 | assertThat(cheese, isNot(smelly)) 57 | @endcode 58 | 59 | Synonym for @ref HC_isNot, available if @c HC_SHORTHAND is defined. 60 | @see HCIsNot 61 | @ingroup core_matchers 62 | */ 63 | #ifdef HC_SHORTHAND 64 | #define isNot HC_isNot 65 | #endif 66 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCIsSame.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsSame.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Is the item the same object as another? 14 | @ingroup core_matchers 15 | */ 16 | @interface HCIsSame : HCBaseMatcher 17 | { 18 | id object; 19 | } 20 | 21 | + (id)isSameAs:(id)anObject; 22 | - (id)initSameAs:(id)anObject; 23 | 24 | @end 25 | 26 | //-------------------------------------------------------------------------------------------------- 27 | 28 | /** 29 | Evaluates to @c YES only when the argument is this same object. 30 | 31 | @b Synonym: @ref sameInstance 32 | @see HCIsSame 33 | @ingroup core_matchers 34 | */ 35 | OBJC_EXPORT id HC_sameInstance(id object); 36 | 37 | /** 38 | sameInstance(object) - 39 | Evaluates to @c YES only when the argument is this same object. 40 | 41 | Synonym for @ref HC_sameInstance, available if @c HC_SHORTHAND is defined. 42 | @see HCIsSame 43 | @ingroup core_matchers 44 | */ 45 | #ifdef HC_SHORTHAND 46 | #define sameInstance HC_sameInstance 47 | #endif 48 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCMatcher.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | A matcher over acceptable values. 14 | 15 | A matcher is able to describe itself to give feedback when it fails. 16 | 17 | HCMatcher implementations should @b not directly implement this protocol. 18 | Instead, @b extend the HCBaseMatcher class, which will ensure that the HCMatcher API can grow 19 | to support new features and remain compatible with all HCMatcher implementations. 20 | 21 | @ingroup core 22 | */ 23 | @protocol HCMatcher 24 | 25 | /** 26 | Evaluates the matcher for argument @a item. 27 | 28 | @param item The object against which the matcher is evaluated. 29 | @return @c YES if @a item matches, otherwise @c NO. 30 | */ 31 | - (BOOL)matches:(id)item; 32 | 33 | /** 34 | Evaluates the matcher for argument @a item. 35 | 36 | @param item The object against which the matcher is evaluated. 37 | @param mismatchDescription The description to be built or appended to if @a item does not match. 38 | @return @c YES if @a item matches, otherwise @c NO. 39 | */ 40 | - (BOOL)matches:(id)item describingMismatchTo:(id)mismatchDescription; 41 | 42 | /** 43 | Generates a description of why the matcher has not accepted the item. 44 | 45 | The description will be part of a larger description of why a matching failed, so it should be 46 | concise. 47 | 48 | This method assumes that @c matches:item is false, but will not check this. 49 | 50 | @param item The item that the HCMatcher has rejected. 51 | @param mismatchDescription The description to be built or appended to. 52 | */ 53 | - (void)describeMismatchOf:(id)item to:(id)mismatchDescription; 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCNumberAssert.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCNumberAssert.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | #import 9 | 10 | @protocol HCMatcher; 11 | 12 | 13 | OBJC_EXPORT void HC_assertThatBoolWithLocation(id testCase, BOOL actual, 14 | id matcher, const char* fileName, int lineNumber); 15 | 16 | /** 17 | Asserts that @c BOOL actual value, converted to an @c NSNumber, satisfies matcher. 18 | 19 | @b Synonym: @ref assertThatBool 20 | @ingroup integration_numeric 21 | */ 22 | #define HC_assertThatBool(actual, matcher) \ 23 | HC_assertThatBoolWithLocation(self, actual, matcher, __FILE__, __LINE__) 24 | 25 | /** 26 | assertThatBool(actual, matcher) - 27 | Asserts that @c BOOL actual value, converted to an @c NSNumber, satisfies matcher. 28 | 29 | Synonym for @ref HC_assertThatBool, available if @c HC_SHORTHAND is defined. 30 | @ingroup integration_numeric 31 | */ 32 | #ifdef HC_SHORTHAND 33 | #define assertThatBool HC_assertThatBool 34 | #endif 35 | 36 | 37 | OBJC_EXPORT void HC_assertThatCharWithLocation(id testCase, char actual, 38 | id matcher, const char* fileName, int lineNumber); 39 | 40 | /** 41 | Asserts that @c char actual value, converted to an @c NSNumber, satisfies matcher. 42 | 43 | @b Synonym: @ref assertThatChar 44 | @ingroup integration_numeric 45 | */ 46 | #define HC_assertThatChar(actual, matcher) \ 47 | HC_assertThatCharWithLocation(self, actual, matcher, __FILE__, __LINE__) 48 | 49 | /** 50 | assertThatChar(actual, matcher) - 51 | Asserts that @c char actual value, converted to an @c NSNumber, satisfies matcher. 52 | 53 | Synonym for @ref HC_assertThatChar, available if @c HC_SHORTHAND is defined. 54 | @ingroup integration_numeric 55 | */ 56 | #ifdef HC_SHORTHAND 57 | #define assertThatChar HC_assertThatChar 58 | #endif 59 | 60 | 61 | OBJC_EXPORT void HC_assertThatDoubleWithLocation(id testCase, double actual, 62 | id matcher, const char* fileName, int lineNumber); 63 | 64 | /** 65 | Asserts that @c double actual value, converted to an @c NSNumber, satisfies matcher. 66 | 67 | @b Synonym: @ref assertThatDouble 68 | @ingroup integration_numeric 69 | */ 70 | #define HC_assertThatDouble(actual, matcher) \ 71 | HC_assertThatDoubleWithLocation(self, actual, matcher, __FILE__, __LINE__) 72 | 73 | /** 74 | HC_assertThatDouble(actual, matcher) - 75 | Asserts that @c double actual value, converted to an @c NSNumber, satisfies matcher. 76 | 77 | Synonym for @ref HC_assertThatDouble, available if @c HC_SHORTHAND is defined. 78 | @ingroup integration_numeric 79 | */ 80 | #ifdef HC_SHORTHAND 81 | #define assertThatDouble HC_assertThatDouble 82 | #endif 83 | 84 | 85 | OBJC_EXPORT void HC_assertThatFloatWithLocation(id testCase, float actual, 86 | id matcher, const char* fileName, int lineNumber); 87 | 88 | /** 89 | Asserts that @c float actual value, converted to an @c NSNumber, satisfies matcher. 90 | 91 | @b Synonym: @ref assertThatFloat 92 | @ingroup integration_numeric 93 | */ 94 | #define HC_assertThatFloat(actual, matcher) \ 95 | HC_assertThatFloatWithLocation(self, actual, matcher, __FILE__, __LINE__) 96 | 97 | /** 98 | assertThatFloat(actual, matcher) - 99 | Asserts that @c float actual value, converted to an @c NSNumber, satisfies matcher. 100 | 101 | Synonym for @ref HC_assertThatFloat, available if @c HC_SHORTHAND is defined. 102 | @ingroup integration_numeric 103 | */ 104 | #ifdef HC_SHORTHAND 105 | #define assertThatFloat HC_assertThatFloat 106 | #endif 107 | 108 | 109 | OBJC_EXPORT void HC_assertThatIntWithLocation(id testCase, int actual, 110 | id matcher, const char* fileName, int lineNumber); 111 | 112 | /** 113 | Asserts that @c int actual value, converted to an @c NSNumber, satisfies matcher. 114 | 115 | @b Synonym: @ref assertThatInt 116 | @ingroup integration_numeric 117 | */ 118 | #define HC_assertThatInt(actual, matcher) \ 119 | HC_assertThatIntWithLocation(self, actual, matcher, __FILE__, __LINE__) 120 | 121 | /** 122 | assertThatInt(actual, matcher) - 123 | Asserts that @c int actual value, converted to an @c NSNumber, satisfies matcher. 124 | 125 | Synonym for @ref HC_assertThatInt, available if @c HC_SHORTHAND is defined. 126 | @ingroup integration_numeric 127 | */ 128 | #ifdef HC_SHORTHAND 129 | #define assertThatInt HC_assertThatInt 130 | #endif 131 | 132 | 133 | OBJC_EXPORT void HC_assertThatLongWithLocation(id testCase, long actual, 134 | id matcher, const char* fileName, int lineNumber); 135 | 136 | /** 137 | Asserts that @c long actual value, converted to an @c NSNumber, satisfies matcher. 138 | 139 | @b Synonym: @ref assertThatLong 140 | @ingroup integration_numeric 141 | */ 142 | #define HC_assertThatLong(actual, matcher) \ 143 | HC_assertThatLongWithLocation(self, actual, matcher, __FILE__, __LINE__) 144 | 145 | /** 146 | assertThatLong(actual, matcher) - 147 | Asserts that @c long actual value, converted to an @c NSNumber, satisfies matcher. 148 | 149 | Synonym for @ref HC_assertThatLong, available if @c HC_SHORTHAND is defined. 150 | @ingroup integration_numeric 151 | */ 152 | #ifdef HC_SHORTHAND 153 | #define assertThatLong HC_assertThatLong 154 | #endif 155 | 156 | 157 | OBJC_EXPORT void HC_assertThatLongLongWithLocation(id testCase, long long actual, 158 | id matcher, const char* fileName, int lineNumber); 159 | 160 | /** 161 | Asserts that long long actual value, converted to an @c NSNumber, satisfies 162 | matcher. 163 | 164 | @b Synonym: @ref assertThatLongLong 165 | @ingroup integration_numeric 166 | */ 167 | #define HC_assertThatLongLong(actual, matcher) \ 168 | HC_assertThatLongLongWithLocation(self, actual, matcher, __FILE__, __LINE__) 169 | 170 | /** 171 | assertThatLongLong(actual, matcher) - 172 | Asserts that long long actual value, converted to an @c NSNumber, satisfies 173 | matcher. 174 | 175 | Synonym for @ref HC_assertThatLongLong, available if @c HC_SHORTHAND is defined. 176 | @ingroup integration_numeric 177 | */ 178 | #ifdef HC_SHORTHAND 179 | #define assertThatLongLong HC_assertThatLongLong 180 | #endif 181 | 182 | 183 | OBJC_EXPORT void HC_assertThatShortWithLocation(id testCase, short actual, 184 | id matcher, const char* fileName, int lineNumber); 185 | 186 | /** 187 | Asserts that @c short actual value, converted to an @c NSNumber, satisfies matcher. 188 | 189 | @b Synonym: @ref assertThatShort 190 | @ingroup integration_numeric 191 | */ 192 | #define HC_assertThatShort(actual, matcher) \ 193 | HC_assertThatShortWithLocation(self, actual, matcher, __FILE__, __LINE__) 194 | 195 | /** 196 | assertThatShort(actual, matcher) - 197 | Asserts that @c short actual value, converted to an @c NSNumber, satisfies matcher. 198 | 199 | Synonym for @ref HC_assertThatShort, available if @c HC_SHORTHAND is defined. 200 | @ingroup integration_numeric 201 | */ 202 | #ifdef HC_SHORTHAND 203 | #define assertThatShort HC_assertThatShort 204 | #endif 205 | 206 | 207 | OBJC_EXPORT void HC_assertThatUnsignedCharWithLocation(id testCase, unsigned char actual, 208 | id matcher, const char* fileName, int lineNumber); 209 | 210 | /** 211 | Asserts that unsigned char actual value, converted to an @c NSNumber, satisfies 212 | matcher. 213 | 214 | @b Synonym: @ref assertThatUnsignedChar 215 | @ingroup integration_numeric 216 | */ 217 | #define HC_assertThatUnsignedChar(actual, matcher) \ 218 | HC_assertThatUnsignedCharWithLocation(self, actual, matcher, __FILE__, __LINE__) 219 | 220 | /** 221 | assertThatUnsignedChar(actual, matcher) - 222 | Asserts that unsigned char actual value, converted to an @c NSNumber, satisfies 223 | matcher. 224 | 225 | Synonym for @ref HC_assertThatUnsignedChar, available if @c HC_SHORTHAND is defined. 226 | @ingroup integration_numeric 227 | */ 228 | #ifdef HC_SHORTHAND 229 | #define assertThatUnsignedChar HC_assertThatUnsignedChar 230 | #endif 231 | 232 | 233 | OBJC_EXPORT void HC_assertThatUnsignedIntWithLocation(id testCase, unsigned int actual, 234 | id matcher, const char* fileName, int lineNumber); 235 | 236 | /** 237 | Asserts that unsigned int actual value, converted to an @c NSNumber, satisfies 238 | matcher. 239 | 240 | @b Synonym: @ref assertThatInt 241 | @ingroup integration_numeric 242 | */ 243 | #define HC_assertThatUnsignedInt(actual, matcher) \ 244 | HC_assertThatUnsignedIntWithLocation(self, actual, matcher, __FILE__, __LINE__) 245 | 246 | /** 247 | assertThatUnsignedInt(actual, matcher) - 248 | Asserts that unsigned int actual value, converted to an @c NSNumber, satisfies 249 | matcher. 250 | 251 | Synonym for @ref HC_assertThatUnsignedInt, available if @c HC_SHORTHAND is defined. 252 | @ingroup integration_numeric 253 | */ 254 | #ifdef HC_SHORTHAND 255 | #define assertThatUnsignedInt HC_assertThatUnsignedInt 256 | #endif 257 | 258 | 259 | OBJC_EXPORT void HC_assertThatUnsignedLongWithLocation(id testCase, unsigned long actual, 260 | id matcher, const char* fileName, int lineNumber); 261 | 262 | /** 263 | Asserts that unsigned long actual value, converted to an @c NSNumber, satisfies 264 | matcher. 265 | 266 | @b Synonym: @ref assertThatUnsignedLong 267 | @ingroup integration_numeric 268 | */ 269 | #define HC_assertThatUnsignedLong(actual, matcher) \ 270 | HC_assertThatUnsignedLongWithLocation(self, actual, matcher, __FILE__, __LINE__) 271 | 272 | /** 273 | assertThatUnsignedLong(actual, matcher) - 274 | Asserts that unsigned long actual value, converted to an @c NSNumber, satisfies 275 | matcher. 276 | 277 | Synonym for @ref HC_assertThatUnsignedLong, available if @c HC_SHORTHAND is defined. 278 | @ingroup integration_numeric 279 | */ 280 | #ifdef HC_SHORTHAND 281 | #define assertThatUnsignedLong HC_assertThatUnsignedLong 282 | #endif 283 | 284 | 285 | OBJC_EXPORT void HC_assertThatUnsignedLongLongWithLocation(id testCase, unsigned long long actual, 286 | id matcher, const char* fileName, int lineNumber); 287 | 288 | /** 289 | Asserts that unsigned long long actual value, converted to an @c NSNumber, 290 | satisfies matcher. 291 | 292 | @b Synonym: @ref assertThatUnsignedLongLong 293 | @ingroup integration_numeric 294 | */ 295 | #define HC_assertThatUnsignedLongLong(actual, matcher) \ 296 | HC_assertThatUnsignedLongLongWithLocation(self, actual, matcher, __FILE__, __LINE__) 297 | 298 | /** 299 | assertThatUnsignedLongLong(actual, matcher) - 300 | Asserts that unsigned long long actual value, converted to an @c NSNumber, 301 | satisfies matcher. 302 | 303 | Synonym for @ref HC_assertThatUnsignedLongLong, available if @c HC_SHORTHAND is defined. 304 | @ingroup integration_numeric 305 | */ 306 | #ifdef HC_SHORTHAND 307 | #define assertThatUnsignedLongLong HC_assertThatUnsignedLongLong 308 | #endif 309 | 310 | 311 | OBJC_EXPORT void HC_assertThatUnsignedShortWithLocation(id testCase, unsigned short actual, 312 | id matcher, const char* fileName, int lineNumber); 313 | 314 | /** 315 | Asserts that unsigned short actual value, converted to an @c NSNumber, satisfies 316 | matcher. 317 | 318 | @b Synonym: @ref assertThatUnsignedShort 319 | @ingroup integration_numeric 320 | */ 321 | #define HC_assertThatUnsignedShort(actual, matcher) \ 322 | HC_assertThatUnsignedShortWithLocation(self, actual, matcher, __FILE__, __LINE__) 323 | 324 | /** 325 | assertThatUnsignedShort(actual, matcher) - 326 | Asserts that unsigned short actual value, converted to an @c NSNumber, satisfies 327 | matcher. 328 | 329 | Synonym for @ref HC_assertThatUnsignedShort, available if @c HC_SHORTHAND is defined. 330 | @ingroup integration_numeric 331 | */ 332 | #ifdef HC_SHORTHAND 333 | #define assertThatUnsignedShort HC_assertThatUnsignedShort 334 | #endif 335 | 336 | 337 | OBJC_EXPORT void HC_assertThatIntegerWithLocation(id testCase, NSInteger actual, 338 | id matcher, const char* fileName, int lineNumber); 339 | 340 | /** 341 | Asserts that @c NSInteger actual value, converted to an @c NSNumber, satisfies matcher. 342 | 343 | @b Synonym: @ref assertThatInteger 344 | @ingroup integration_numeric 345 | */ 346 | #define HC_assertThatInteger(actual, matcher) \ 347 | HC_assertThatIntegerWithLocation(self, actual, matcher, __FILE__, __LINE__) 348 | 349 | /** 350 | assertThatInteger(actual, matcher) - 351 | Asserts that @c NSInteger actual value, converted to an @c NSNumber, satisfies matcher. 352 | 353 | Synonym for @ref HC_assertThatInteger, available if @c HC_SHORTHAND is defined. 354 | @ingroup integration_numeric 355 | */ 356 | #ifdef HC_SHORTHAND 357 | #define assertThatInteger HC_assertThatInteger 358 | #endif 359 | 360 | 361 | OBJC_EXPORT void HC_assertThatUnsignedIntegerWithLocation(id testCase, NSUInteger actual, 362 | id matcher, const char* fileName, int lineNumber); 363 | 364 | /** 365 | Asserts that @c NSUInteger actual value, converted to an @c NSNumber, satisfies matcher. 366 | 367 | @b Synonym: @ref assertThatUnsignedInteger 368 | @ingroup integration_numeric 369 | */ 370 | #define HC_assertThatUnsignedInteger(actual, matcher) \ 371 | HC_assertThatUnsignedIntegerWithLocation(self, actual, matcher, __FILE__, __LINE__) 372 | 373 | /** 374 | assertThatUnsignedInteger(actual, matcher) - 375 | Asserts that @c NSUInteger actual value, converted to an @c NSNumber, satisfies matcher. 376 | 377 | Synonym for @ref HC_assertThatUnsignedInteger, available if @c HC_SHORTHAND is defined. 378 | @ingroup integration_numeric 379 | */ 380 | #ifdef HC_SHORTHAND 381 | #define assertThatUnsignedInteger HC_assertThatUnsignedInteger 382 | #endif 383 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCOrderingComparison.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCOrderingComparison.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | @interface HCOrderingComparison : HCBaseMatcher 13 | { 14 | id expected; 15 | NSComparisonResult minCompare; 16 | NSComparisonResult maxCompare; 17 | NSString *comparisonDescription; 18 | } 19 | 20 | + (id)compare:(id)expectedValue 21 | minCompare:(NSComparisonResult)min 22 | maxCompare:(NSComparisonResult)max 23 | comparisonDescription:(NSString *)comparisonDescription; 24 | 25 | - (id)initComparing:(id)expectedValue 26 | minCompare:(NSComparisonResult)min 27 | maxCompare:(NSComparisonResult)max 28 | comparisonDescription:(NSString *)comparisonDescription; 29 | 30 | @end 31 | 32 | //-------------------------------------------------------------------------------------------------- 33 | 34 | /** 35 | Is value > expected? 36 | 37 | @b Synonym: @ref greaterThan 38 | @ingroup number_matchers 39 | */ 40 | OBJC_EXPORT id HC_greaterThan(id expected); 41 | 42 | /** 43 | greaterThan(expected) - 44 | Is value > expected? 45 | 46 | Synonym for @ref HC_greaterThan, available if @c HC_SHORTHAND is defined. 47 | @ingroup number_matchers 48 | */ 49 | #ifdef HC_SHORTHAND 50 | #define greaterThan HC_greaterThan 51 | #endif 52 | 53 | 54 | /** 55 | Is value >= expected? 56 | 57 | @b Synonym: @ref greaterThanOrEqualTo 58 | @ingroup number_matchers 59 | */ 60 | OBJC_EXPORT id HC_greaterThanOrEqualTo(id expected); 61 | 62 | /** 63 | greaterThanOrEqualTo(expected) - 64 | Is value >= expected? 65 | 66 | Synonym for @ref HC_greaterThan, available if @c HC_SHORTHAND is defined. 67 | @ingroup number_matchers 68 | */ 69 | #ifdef HC_SHORTHAND 70 | #define greaterThanOrEqualTo HC_greaterThanOrEqualTo 71 | #endif 72 | 73 | 74 | /** 75 | Is value < expected? 76 | 77 | @b Synonym: @ref lessThan 78 | @ingroup number_matchers 79 | */ 80 | OBJC_EXPORT id HC_lessThan(id expected); 81 | 82 | /** 83 | lessThan(expected) - 84 | Is value < expected? 85 | 86 | Synonym for @ref HC_greaterThan, available if @c HC_SHORTHAND is defined. 87 | @ingroup number_matchers 88 | */ 89 | #ifdef HC_SHORTHAND 90 | #define lessThan HC_lessThan 91 | #endif 92 | 93 | 94 | /** 95 | Is value <= expected? 96 | 97 | @b Synonym: @ref lessThanOrEqualTo 98 | @ingroup number_matchers 99 | */ 100 | OBJC_EXPORT id HC_lessThanOrEqualTo(id expected); 101 | 102 | /** 103 | lessThanOrEqualTo(expected) - 104 | Is value <= expected? 105 | 106 | Synonym for @ref HC_lessThanOrEqualTo, available if @c HC_SHORTHAND is defined. 107 | @ingroup number_matchers 108 | */ 109 | #ifdef HC_SHORTHAND 110 | #define lessThanOrEqualTo HC_lessThanOrEqualTo 111 | #endif 112 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCRequireNonNilObject.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCRequireNonNilObject.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | #import 9 | #import 10 | 11 | 12 | /** 13 | Throws an NSException if @a obj is @c nil. 14 | @ingroup helpers 15 | */ 16 | OBJC_EXPORT void HCRequireNonNilObject(id obj); 17 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCRequireNonNilString.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCRequireNonNilString.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | #import 9 | #import 10 | 11 | 12 | /** 13 | Throws an NSException if @a string is @c nil. 14 | @b Deprecated: Use @ref HCRequireNonNilObject instead. 15 | @ingroup helpers 16 | */ 17 | OBJC_EXPORT void HCRequireNonNilString(NSString *string) __attribute__((deprecated)); 18 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCSelfDescribing.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCSelfDescribing.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | @protocol HCDescription; 12 | 13 | 14 | /** 15 | The ability of an object to describe itself. 16 | 17 | @ingroup core 18 | */ 19 | @protocol HCSelfDescribing 20 | 21 | /** 22 | Generates a description of the object. 23 | 24 | The description may be part of a description of a larger object of which this is just a 25 | component, so it should be worded appropriately. 26 | 27 | @param description The description to be built or appended to. 28 | */ 29 | - (void)describeTo:(id)description; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCStringContains.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCStringContains.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Tests if the argument is a string that contains a substring. 14 | @ingroup text_matchers 15 | */ 16 | @interface HCStringContains : HCSubstringMatcher 17 | 18 | + (id)stringContains:(NSString *)aSubstring; 19 | 20 | @end 21 | 22 | //-------------------------------------------------------------------------------------------------- 23 | 24 | /** 25 | Tests if the argument is a string that contains a substring. 26 | 27 | @b Synonym: @ref containsString 28 | @see HCStringContains 29 | @ingroup text_matchers 30 | */ 31 | OBJC_EXPORT id HC_containsString(NSString *aSubstring); 32 | 33 | /** 34 | containsString(substring) - 35 | Tests if the argument is a string that contains a substring. 36 | 37 | Synonym for @ref HC_containsString, available if @c HC_SHORTHAND is defined. 38 | @see HCStringContains 39 | @ingroup text_matchers 40 | */ 41 | #ifdef HC_SHORTHAND 42 | #define containsString HC_containsString 43 | #endif 44 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCStringDescription.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCStringDescription.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | @protocol HCSelfDescribing; 12 | 13 | 14 | /** 15 | An HCDescription that is stored as a string. 16 | 17 | @ingroup core 18 | */ 19 | @interface HCStringDescription : HCBaseDescription 20 | { 21 | NSMutableString *accumulator; 22 | } 23 | 24 | /** 25 | Returns the description of an HCSelfDescribing object as a string. 26 | 27 | @param selfDescribing The object to be described. 28 | @return The description of the object. 29 | */ 30 | + (NSString *)stringFrom:(id)selfDescribing; 31 | 32 | /** 33 | Returns an empty description. 34 | */ 35 | + (HCStringDescription *)stringDescription; 36 | 37 | /** 38 | Returns an initialized HCStringDescription object that is empty. 39 | */ 40 | - (id)init; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCStringEndsWith.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCStringEndsWith.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Tests if the argument is a string that ends with a substring. 14 | @ingroup text_matchers 15 | */ 16 | @interface HCStringEndsWith : HCSubstringMatcher 17 | 18 | + (id)stringEndsWith:(NSString *)aSubstring; 19 | 20 | @end 21 | 22 | //-------------------------------------------------------------------------------------------------- 23 | 24 | /** 25 | Tests if the argument is a string that ends with a substring. 26 | 27 | @b Synonym: @ref endsWith 28 | @see HCStringEndsWith 29 | @ingroup text_matchers 30 | */ 31 | OBJC_EXPORT id HC_endsWith(NSString *aSubstring); 32 | 33 | /** 34 | endsWith(substring) - 35 | Tests if the argument is a string that ends with a substring. 36 | 37 | Synonym for @ref HC_endsWith, available if @c HC_SHORTHAND is defined. 38 | @see HCStringEndsWith 39 | @ingroup text_matchers 40 | */ 41 | #ifdef HC_SHORTHAND 42 | #define endsWith HC_endsWith 43 | #endif 44 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCStringStartsWith.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCStringStartsWith.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | /** 13 | Tests if the argument is a string that starts with a substring. 14 | @ingroup text_matchers 15 | */ 16 | @interface HCStringStartsWith : HCSubstringMatcher 17 | 18 | + (id)stringStartsWith:(NSString *)aSubstring; 19 | 20 | @end 21 | 22 | //-------------------------------------------------------------------------------------------------- 23 | 24 | /** 25 | Tests if the argument is a string that starts with a substring. 26 | 27 | @b Synonym: @ref startsWith 28 | @see HCStringStartsWith 29 | @ingroup text_matchers 30 | */ 31 | OBJC_EXPORT id HC_startsWith(NSString *aSubstring); 32 | 33 | /** 34 | startsWith(substring) - 35 | Tests if the argument is a string that starts with a substring. 36 | 37 | Synonym for @ref HC_startsWith, available if @c HC_SHORTHAND is defined. 38 | @see HCStringStartsWith 39 | @ingroup text_matchers 40 | */ 41 | #ifdef HC_SHORTHAND 42 | #define startsWith HC_startsWith 43 | #endif 44 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCSubstringMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCSubstringMatcher.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | 12 | @interface HCSubstringMatcher : HCBaseMatcher 13 | { 14 | NSString *substring; 15 | } 16 | 17 | - (id)initWithSubstring:(NSString *)aSubstring; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/HCWrapInMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCWrapInMatcher.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | #import 9 | 10 | @protocol HCMatcher; 11 | 12 | 13 | /** 14 | Wraps argument in a matcher, if necessary. 15 | @return The argument as-if if it is already a matcher, otherwise wrapped in an @ref equalTo matcher. 16 | @ingroup helpers 17 | */ 18 | OBJC_EXPORT id HCWrapInMatcher(id matcherOrValue); 19 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/NSObject+HCSelfDescribingValue.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - NSObject+HCSelfDescribingValue.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | #import 9 | 10 | @protocol HCDescription; 11 | 12 | /** 13 | This category allows any object to satisfy the HCSelfDescribing protocol. 14 | 15 | @b Deprecated: No longer needed now that @ref appendDescriptionOf: handles all types of objects. 16 | 17 | @ingroup core 18 | */ 19 | @interface NSObject (HCSelfDescribingValue) 20 | 21 | /** 22 | Generates a description of the object. 23 | 24 | @param description The description to be appended to. 25 | */ 26 | - (void)describeTo:(id)description __attribute__((deprecated)); 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Headers/OCHamcrestIOS.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - OCHamcrest.h 3 | // Copyright 2011 hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | /** 9 | @defgroup library Matcher Library 10 | 11 | Library of Matcher implementations 12 | */ 13 | 14 | /** 15 | @defgroup core_matchers Core Matchers 16 | 17 | Fundamental matchers of objects and values, and composite matchers 18 | 19 | @ingroup library 20 | */ 21 | #import 22 | #import 23 | #import 24 | #import 25 | #import 26 | #import 27 | #import 28 | #import 29 | #import 30 | #import 31 | 32 | /** 33 | @defgroup collection_matchers Collection Matchers 34 | 35 | Matchers of collections 36 | 37 | @ingroup library 38 | */ 39 | #import 40 | #import 41 | #import 42 | #import 43 | #import 44 | #import 45 | #import 46 | #import 47 | #import 48 | #import 49 | #import 50 | 51 | /** 52 | @defgroup number_matchers Number Matchers 53 | 54 | Matchers that perform numeric comparisons 55 | 56 | @ingroup library 57 | */ 58 | #import 59 | #import 60 | 61 | /** 62 | @defgroup primitive_number_matchers Primitive Number Matchers 63 | 64 | Matchers for testing equality against primitive numeric types 65 | 66 | @ingroup number_matchers 67 | */ 68 | #import 69 | 70 | /** 71 | @defgroup object_matchers Object Matchers 72 | 73 | Matchers that inspect objects 74 | 75 | @ingroup library 76 | */ 77 | #import 78 | 79 | /** 80 | @defgroup text_matchers Text Matchers 81 | 82 | Matchers that perform text comparisons 83 | 84 | @ingroup library 85 | */ 86 | #import 87 | #import 88 | #import 89 | #import 90 | #import 91 | 92 | /** 93 | @defgroup integration Unit Test Integration 94 | */ 95 | #import 96 | 97 | /** 98 | @defgroup integration_numeric Unit Tests of Primitive Numbers 99 | 100 | Unit test integration for primitive numbers 101 | 102 | @ingroup integration 103 | */ 104 | #import 105 | 106 | /** 107 | @defgroup core Core API 108 | */ 109 | 110 | /** 111 | @defgroup helpers Helpers 112 | 113 | Utilities for writing Matchers 114 | 115 | @ingroup core 116 | */ 117 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/OCHamcrestIOS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicalpanda/Xcode-Templates/b3d29d42246abe84f6dce10f7a55d6d62abfdee3/Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/OCHamcrestIOS -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | OCHamcrestIOS 9 | CFBundleIdentifier 10 | org.hamcrest.OCHamcrestIOS 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | OCHamcrestIOS 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.4 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.4 23 | NSHumanReadableCopyright 24 | Copyright © 2011 hamcrest.org 25 | 26 | 27 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/A/Resources/LICENSE.txt: -------------------------------------------------------------------------------- 1 | BSD License 2 | 3 | Copyright 2011 hamcrest.org 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | Redistributions of source code must retain the above copyright notice, this list of 10 | conditions and the following disclaimer. Redistributions in binary form must reproduce 11 | the above copyright notice, this list of conditions and the following disclaimer in 12 | the documentation and/or other materials provided with the distribution. 13 | 14 | Neither the name of Hamcrest nor the names of its contributors may be used to endorse 15 | or promote products derived from this software without specific prior written 16 | permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 21 | SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 23 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 26 | WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 27 | DAMAGE. 28 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCHamcrestIOS.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCMock.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCMock.framework/OCMock: -------------------------------------------------------------------------------- 1 | Versions/Current/OCMock -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCMock.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCMock.framework/Versions/A/Headers/NSNotificationCenter+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id: NSNotificationCenter+OCMAdditions.h 57 2010-07-19 06:14:27Z erik $ 3 | // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | @class OCMockObserver; 9 | 10 | 11 | @interface NSNotificationCenter(OCMAdditions) 12 | 13 | - (void)addMockObserver:(OCMockObserver *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCMock.framework/Versions/A/Headers/OCMArg.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id: OCMArg.h 65 2010-07-28 01:49:42Z erik $ 3 | // Copyright (c) 2009-2010 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | @interface OCMArg : NSObject 9 | 10 | // constraining arguments 11 | 12 | + (id)any; 13 | + (void *)anyPointer; 14 | + (id)isNil; 15 | + (id)isNotNil; 16 | + (id)isNotEqual:(id)value; 17 | + (id)checkWithSelector:(SEL)selector onObject:(id)anObject; 18 | #if NS_BLOCKS_AVAILABLE 19 | + (id)checkWithBlock:(BOOL (^)(id))block; 20 | #endif 21 | 22 | // manipulating arguments 23 | 24 | + (id *)setTo:(id)value; 25 | 26 | // internal use only 27 | 28 | + (id)resolveSpecialValues:(NSValue *)value; 29 | 30 | @end 31 | 32 | #define OCMOCK_ANY [OCMArg any] 33 | #define OCMOCK_VALUE(variable) [NSValue value:&variable withObjCType:@encode(__typeof__(variable))] 34 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCMock.framework/Versions/A/Headers/OCMConstraint.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id: OCMConstraint.h 57 2010-07-19 06:14:27Z erik $ 3 | // Copyright (c) 2007-2010 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | 9 | @interface OCMConstraint : NSObject 10 | 11 | + (id)constraint; 12 | - (BOOL)evaluate:(id)value; 13 | 14 | // if you are looking for any, isNil, etc, they have moved to OCMArg 15 | 16 | // try to use [OCMArg checkWith...] instead of the constraintWith... methods below 17 | 18 | + (id)constraintWithSelector:(SEL)aSelector onObject:(id)anObject; 19 | + (id)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue; 20 | 21 | 22 | @end 23 | 24 | @interface OCMAnyConstraint : OCMConstraint 25 | @end 26 | 27 | @interface OCMIsNilConstraint : OCMConstraint 28 | @end 29 | 30 | @interface OCMIsNotNilConstraint : OCMConstraint 31 | @end 32 | 33 | @interface OCMIsNotEqualConstraint : OCMConstraint 34 | { 35 | @public 36 | id testValue; 37 | } 38 | 39 | @end 40 | 41 | @interface OCMInvocationConstraint : OCMConstraint 42 | { 43 | @public 44 | NSInvocation *invocation; 45 | } 46 | 47 | @end 48 | 49 | #if NS_BLOCKS_AVAILABLE 50 | 51 | @interface OCMBlockConstraint : OCMConstraint 52 | { 53 | BOOL (^block)(id); 54 | } 55 | 56 | - (id)initWithConstraintBlock:(BOOL (^)(id))block; 57 | 58 | @end 59 | 60 | #endif 61 | 62 | 63 | #define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self] 64 | #define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)] 65 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCMock.framework/Versions/A/Headers/OCMock.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id: OCMock.h 39 2009-04-09 05:31:28Z erik $ 3 | // Copyright (c) 2004-2008 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | #import 8 | #import 9 | #import 10 | #import 11 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCMock.framework/Versions/A/Headers/OCMockObject.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id: OCMockObject.h 69 2010-08-20 16:05:58Z erik $ 3 | // Copyright (c) 2004-2008 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | @interface OCMockObject : NSProxy 9 | { 10 | BOOL isNice; 11 | BOOL expectationOrderMatters; 12 | NSMutableArray *recorders; 13 | NSMutableArray *expectations; 14 | NSMutableArray *rejections; 15 | NSMutableArray *exceptions; 16 | } 17 | 18 | + (id)mockForClass:(Class)aClass; 19 | + (id)mockForProtocol:(Protocol *)aProtocol; 20 | + (id)partialMockForObject:(NSObject *)anObject; 21 | 22 | + (id)niceMockForClass:(Class)aClass; 23 | + (id)niceMockForProtocol:(Protocol *)aProtocol; 24 | 25 | + (id)observerMock; 26 | 27 | - (id)init; 28 | 29 | - (void)setExpectationOrderMatters:(BOOL)flag; 30 | 31 | - (id)stub; 32 | - (id)expect; 33 | - (id)reject; 34 | 35 | - (void)verify; 36 | 37 | // internal use only 38 | 39 | - (id)getNewRecorder; 40 | - (BOOL)handleInvocation:(NSInvocation *)anInvocation; 41 | - (void)handleUnRecordedInvocation:(NSInvocation *)anInvocation; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCMock.framework/Versions/A/Headers/OCMockRecorder.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id: OCMockRecorder.h 68 2010-08-20 13:20:52Z erik $ 3 | // Copyright (c) 2004-2010 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | @interface OCMockRecorder : NSProxy 9 | { 10 | id signatureResolver; 11 | NSInvocation *recordedInvocation; 12 | NSMutableArray *invocationHandlers; 13 | } 14 | 15 | - (id)initWithSignatureResolver:(id)anObject; 16 | 17 | - (BOOL)matchesInvocation:(NSInvocation *)anInvocation; 18 | - (void)releaseInvocation; 19 | 20 | - (id)andReturn:(id)anObject; 21 | - (id)andReturnValue:(NSValue *)aValue; 22 | - (id)andThrow:(NSException *)anException; 23 | - (id)andPost:(NSNotification *)aNotification; 24 | - (id)andCall:(SEL)selector onObject:(id)anObject; 25 | #if NS_BLOCKS_AVAILABLE 26 | - (id)andDo:(void (^)(NSInvocation *))block; 27 | #endif 28 | - (id)andForwardToRealObject; 29 | 30 | - (NSArray *)invocationHandlers; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCMock.framework/Versions/A/OCMock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicalpanda/Xcode-Templates/b3d29d42246abe84f6dce10f7a55d6d62abfdee3/Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCMock.framework/Versions/A/OCMock -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCMock.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | OCMock 9 | CFBundleIdentifier 10 | com.mulle-kybernetik.OCMock 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | OCMock 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.29 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | NSHumanReadableCopyright 24 | Copyright © 2004-2009 Mulle Kybernetik. 25 | 26 | 27 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCMock.framework/Versions/A/Resources/License.txt: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) 2004-2011 by Mulle Kybernetik. All rights reserved. 3 | 4 | Permission to use, copy, modify and distribute this software and its documentation 5 | is hereby granted, provided that both the copyright notice and this permission 6 | notice appear in all copies of the software, derivative works or modified versions, 7 | and any portions thereof, and that both notices appear in supporting documentation, 8 | and that credit is given to Mulle Kybernetik in all documents and publicity 9 | pertaining to direct or indirect use of this code or its derivatives. 10 | 11 | THIS IS EXPERIMENTAL SOFTWARE AND IT IS KNOWN TO HAVE BUGS, SOME OF WHICH MAY HAVE 12 | SERIOUS CONSEQUENCES. THE COPYRIGHT HOLDER ALLOWS FREE USE OF THIS SOFTWARE IN ITS 13 | "AS IS" CONDITION. THE COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY 14 | DAMAGES WHATSOEVER RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE 15 | OR OF ANY DERIVATIVE WORK. -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCMock.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCMock/Headers/NSNotificationCenter+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id: NSNotificationCenter+OCMAdditions.h 57 2010-07-19 06:14:27Z erik $ 3 | // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | @class OCMockObserver; 9 | 10 | 11 | @interface NSNotificationCenter(OCMAdditions) 12 | 13 | - (void)addMockObserver:(OCMockObserver *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCMock/Headers/OCMArg.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id: OCMArg.h 65 2010-07-28 01:49:42Z erik $ 3 | // Copyright (c) 2009-2010 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | @interface OCMArg : NSObject 9 | 10 | // constraining arguments 11 | 12 | + (id)any; 13 | + (void *)anyPointer; 14 | + (id)isNil; 15 | + (id)isNotNil; 16 | + (id)isNotEqual:(id)value; 17 | + (id)checkWithSelector:(SEL)selector onObject:(id)anObject; 18 | #if NS_BLOCKS_AVAILABLE 19 | + (id)checkWithBlock:(BOOL (^)(id))block; 20 | #endif 21 | 22 | // manipulating arguments 23 | 24 | + (id *)setTo:(id)value; 25 | 26 | // internal use only 27 | 28 | + (id)resolveSpecialValues:(NSValue *)value; 29 | 30 | @end 31 | 32 | #define OCMOCK_ANY [OCMArg any] 33 | #define OCMOCK_VALUE(variable) [NSValue value:&variable withObjCType:@encode(__typeof__(variable))] 34 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCMock/Headers/OCMConstraint.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id: OCMConstraint.h 57 2010-07-19 06:14:27Z erik $ 3 | // Copyright (c) 2007-2010 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | 9 | @interface OCMConstraint : NSObject 10 | 11 | + (id)constraint; 12 | - (BOOL)evaluate:(id)value; 13 | 14 | // if you are looking for any, isNil, etc, they have moved to OCMArg 15 | 16 | // try to use [OCMArg checkWith...] instead of the constraintWith... methods below 17 | 18 | + (id)constraintWithSelector:(SEL)aSelector onObject:(id)anObject; 19 | + (id)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue; 20 | 21 | 22 | @end 23 | 24 | @interface OCMAnyConstraint : OCMConstraint 25 | @end 26 | 27 | @interface OCMIsNilConstraint : OCMConstraint 28 | @end 29 | 30 | @interface OCMIsNotNilConstraint : OCMConstraint 31 | @end 32 | 33 | @interface OCMIsNotEqualConstraint : OCMConstraint 34 | { 35 | @public 36 | id testValue; 37 | } 38 | 39 | @end 40 | 41 | @interface OCMInvocationConstraint : OCMConstraint 42 | { 43 | @public 44 | NSInvocation *invocation; 45 | } 46 | 47 | @end 48 | 49 | #if NS_BLOCKS_AVAILABLE 50 | 51 | @interface OCMBlockConstraint : OCMConstraint 52 | { 53 | BOOL (^block)(id); 54 | } 55 | 56 | - (id)initWithConstraintBlock:(BOOL (^)(id))block; 57 | 58 | @end 59 | 60 | #endif 61 | 62 | 63 | #define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self] 64 | #define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)] 65 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCMock/Headers/OCMock.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id: OCMock.h 39 2009-04-09 05:31:28Z erik $ 3 | // Copyright (c) 2004-2008 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | #import 8 | #import 9 | #import 10 | #import 11 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCMock/Headers/OCMockObject.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id: OCMockObject.h 69 2010-08-20 16:05:58Z erik $ 3 | // Copyright (c) 2004-2008 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | @interface OCMockObject : NSProxy 9 | { 10 | BOOL isNice; 11 | BOOL expectationOrderMatters; 12 | NSMutableArray *recorders; 13 | NSMutableArray *expectations; 14 | NSMutableArray *rejections; 15 | NSMutableArray *exceptions; 16 | } 17 | 18 | + (id)mockForClass:(Class)aClass; 19 | + (id)mockForProtocol:(Protocol *)aProtocol; 20 | + (id)partialMockForObject:(NSObject *)anObject; 21 | 22 | + (id)niceMockForClass:(Class)aClass; 23 | + (id)niceMockForProtocol:(Protocol *)aProtocol; 24 | 25 | + (id)observerMock; 26 | 27 | - (id)init; 28 | 29 | - (void)setExpectationOrderMatters:(BOOL)flag; 30 | 31 | - (id)stub; 32 | - (id)expect; 33 | - (id)reject; 34 | 35 | - (void)verify; 36 | 37 | // internal use only 38 | 39 | - (id)getNewRecorder; 40 | - (BOOL)handleInvocation:(NSInvocation *)anInvocation; 41 | - (void)handleUnRecordedInvocation:(NSInvocation *)anInvocation; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCMock/Headers/OCMockRecorder.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id: OCMockRecorder.h 68 2010-08-20 13:20:52Z erik $ 3 | // Copyright (c) 2004-2010 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | @interface OCMockRecorder : NSProxy 9 | { 10 | id signatureResolver; 11 | NSInvocation *recordedInvocation; 12 | NSMutableArray *invocationHandlers; 13 | } 14 | 15 | - (id)initWithSignatureResolver:(id)anObject; 16 | 17 | - (BOOL)matchesInvocation:(NSInvocation *)anInvocation; 18 | - (void)releaseInvocation; 19 | 20 | - (id)andReturn:(id)anObject; 21 | - (id)andReturnValue:(NSValue *)aValue; 22 | - (id)andThrow:(NSException *)anException; 23 | - (id)andPost:(NSNotification *)aNotification; 24 | - (id)andCall:(SEL)selector onObject:(id)anObject; 25 | #if NS_BLOCKS_AVAILABLE 26 | - (id)andDo:(void (^)(NSInvocation *))block; 27 | #endif 28 | - (id)andForwardToRealObject; 29 | 30 | - (NSArray *)invocationHandlers; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCMock/libOCMock.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicalpanda/Xcode-Templates/b3d29d42246abe84f6dce10f7a55d6d62abfdee3/Project Templates/IOS Window-Based Application with Unit Tests/Frameworks/Testing/OCMock/libOCMock.a -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/MainWindow.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1056 5 | 10J869 6 | 851 7 | 1038.35 8 | 461.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 141 12 | 13 | 14 | YES 15 | 16 | 17 | YES 18 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 19 | 20 | 21 | YES 22 | 23 | YES 24 | 25 | 26 | YES 27 | 28 | 29 | 30 | YES 31 | 32 | IBFilesOwner 33 | IBCocoaTouchFramework 34 | 35 | 36 | IBFirstResponder 37 | IBCocoaTouchFramework 38 | 39 | 40 | IBCocoaTouchFramework 41 | 42 | 43 | 44 | 1316 45 | 46 | {320, 480} 47 | 48 | 1 49 | MSAxIDEAA 50 | 51 | NO 52 | NO 53 | 54 | IBCocoaTouchFramework 55 | YES 56 | 57 | 58 | 59 | 60 | YES 61 | 62 | 63 | delegate 64 | 65 | 66 | 67 | 4 68 | 69 | 70 | 71 | window 72 | 73 | 74 | 75 | 5 76 | 77 | 78 | 79 | 80 | YES 81 | 82 | 0 83 | 84 | 85 | 86 | 87 | 88 | 2 89 | 90 | 91 | YES 92 | 93 | 94 | 95 | 96 | -1 97 | 98 | 99 | File's Owner 100 | 101 | 102 | 3 103 | 104 | 105 | 106 | 107 | -2 108 | 109 | 110 | 111 | 112 | 113 | 114 | YES 115 | 116 | YES 117 | -1.CustomClassName 118 | -2.CustomClassName 119 | 2.IBAttributePlaceholdersKey 120 | 2.IBEditorWindowLastContentRect 121 | 2.IBPluginDependency 122 | 3.CustomClassName 123 | 3.IBPluginDependency 124 | 125 | 126 | YES 127 | UIApplication 128 | UIResponder 129 | 130 | YES 131 | 132 | 133 | YES 134 | 135 | 136 | {{198, 376}, {320, 480}} 137 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 138 | ___PROJECTNAMEASIDENTIFIER___AppDelegate 139 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 140 | 141 | 142 | 143 | YES 144 | 145 | 146 | YES 147 | 148 | 149 | 150 | 151 | YES 152 | 153 | 154 | YES 155 | 156 | 157 | 158 | 9 159 | 160 | 161 | 162 | YES 163 | 164 | ___PROJECTNAMEASIDENTIFIER___AppDelegate 165 | NSObject 166 | 167 | window 168 | UIWindow 169 | 170 | 171 | window 172 | 173 | window 174 | UIWindow 175 | 176 | 177 | 178 | IBUserSource 179 | 180 | 181 | 182 | 183 | 184 | 0 185 | IBCocoaTouchFramework 186 | 187 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 188 | 189 | 190 | YES 191 | Testing.xcodeproj 192 | 3 193 | 141 194 | 195 | 196 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Unit Tests/SampleTestCase.h: -------------------------------------------------------------------------------- 1 | // 2 | // SampleTestCase.h 3 | // 4 | // Created by ___FULLUSERNAME___ on ___DATE___. 5 | // Copyright ___YEAR___ ___ORGANIZATIONNAME___ rights reserved. 6 | // 7 | 8 | #import 9 | 10 | 11 | 12 | #import 13 | #import "OCMock.h" 14 | 15 | @interface SampleTestCase : GHTestCase { } 16 | @end -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/Unit Tests/SampleTestCase.m: -------------------------------------------------------------------------------- 1 | // 2 | // SampleTestCase.m 3 | // 4 | // Created by ___FULLUSERNAME___ on ___DATE___. 5 | // Copyright ___YEAR___ ___ORGANIZATIONNAME___ rights reserved. 6 | // 7 | 8 | #import "SampleTestCase.h" 9 | 10 | 11 | @implementation SampleTestCase 12 | 13 | - (void)testSimplePass 14 | { 15 | // Another test 16 | } 17 | 18 | - (void)testSimpleFail 19 | { 20 | GHAssertTrue(NO, nil); 21 | } 22 | 23 | // simple test to ensure building, linking, and running test case works in the project 24 | - (void)testOCMockPass 25 | { 26 | id mock = [OCMockObject mockForClass:NSString.class]; 27 | [[[mock stub] andReturn:@"mocktest"] lowercaseString]; 28 | 29 | NSString *returnValue = [mock lowercaseString]; 30 | GHAssertEqualObjects(@"mocktest", returnValue, @"Should have returned the expected string."); 31 | } 32 | 33 | - (void)testOCMockFail 34 | { 35 | id mock = [OCMockObject mockForClass:NSString.class]; 36 | [[[mock stub] andReturn:@"mocktest"] lowercaseString]; 37 | 38 | NSString *returnValue = [mock lowercaseString]; 39 | GHAssertEqualObjects(@"thisIsTheWrongValueToCheck", returnValue, @"Should have returned the expected string."); 40 | } 41 | 42 | @end -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/___PROJECTNAMEASIDENTIFIER___-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | NSMainNibFile 28 | MainWindow 29 | 30 | 31 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/___PROJECTNAMEASIDENTIFIER___Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.${PRODUCT_NAME:identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | 20 | 21 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/___PROJECTNAMEASIDENTIFIER____Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the '___PROJECTNAME___' target in the '___PROJECTNAME___' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/___PROJECTNAME___.xcodeproj/TemplateIcon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magicalpanda/Xcode-Templates/b3d29d42246abe84f6dce10f7a55d6d62abfdee3/Project Templates/IOS Window-Based Application with Unit Tests/___PROJECTNAME___.xcodeproj/TemplateIcon.icns -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/___PROJECTNAME___.xcodeproj/TemplateInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Description 6 | This project builds an iOS Window-based application in Objective-C with GHUnit, OCMock, and OCHamcrest projects setup in another target. 7 | 8 | 9 | -------------------------------------------------------------------------------- /Project Templates/IOS Window-Based Application with Unit Tests/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // 4 | // Created by ___FULLUSERNAME___ on ___DATE___. 5 | // Copyright ___YEAR___ ___ORGANIZATIONNAME___ rights reserved. 6 | // 7 | 8 | #import 9 | 10 | int main(int argc, char *argv[]) 11 | { 12 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 13 | int retVal = UIApplicationMain(argc, argv, nil, nil); 14 | [pool release]; 15 | return retVal; 16 | } 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Magical Xcode Project Templates 2 | 3 | 4 | The Panda likes to get up and running with his iOS projects quickly. He also likes to make sure his apps work, and thus is a furious advocate of unit testing. 5 | 6 | 7 | ## Installation 8 | 9 | To use these magical Xcode project templates, simply copy each folder to: 10 | 11 | ~/Library/Application Support/Developer/Shared/Xcode/Project Templates 12 | 13 | If the *Project Templates* doesn't exist, just create it. 14 | You may need to restart Xcode. 15 | 16 | ## Templates 17 | 18 | ### iOS with Unit Testing 19 | 20 | This template includes: 21 | 22 | * a bare bones iOS project 23 | * a separate target setup to run with the following test Setup: 24 | + [GHUnit](http://www.github.com/gabriel/gh-unit) 25 | + [OCMock](http://www.mulle-kybernetik.com/software/OCMock/) 26 | + [OCHamcrest](http://code.google.com/p/hamcrest/wiki/TutorialObjectiveC) 27 | 28 | 29 | ### Cocoa Framework with MacRuby tests 30 | 31 | * a Cocoa Framework target 32 | * Required Gems 33 | + bundler 34 | + rack 35 | + bacon 36 | + dispatch 37 | * Required Ruby 38 | + [MacRuby 0.10](http://macruby.org/downloads.html) 39 | * a Unit Test bundle with a script to run all files with the file template "*_spec.rb" --------------------------------------------------------------------------------