OCUnitの履歴
XCode 3.2.3
準備
ターゲット→新規ターゲット→Unit Test Bundle
新規ファイル→Objective-C Test Case Class(ターゲットはUnitTestBundleで)
Cocoa Application でやってるサイトの通りやるとうまくいかなかった。
普通にiPhoneプロジェクトならほぼ何もしなくてもOK。
用意済みのassertion
#define STAssertNil(a1, description, ...) #define STAssertNotNil(a1, description, ...) #define STAssertTrue(expression, description, ...) #define STAssertFalse(expression, description, ...) #define STAssertEqualObjects(a1, a2, description, ...) #define STAssertEquals(a1, a2, description, ...) #define STAssertEqualsWithAccuracy(left, right, accuracy, description, ...) #define STAssertThrows(expression, description, ...) #define STAssertThrowsSpecific(expression, specificException, description, ...) #define STAssertThrowsSpecificNamed(expr, specificException, aName, description, ...) #define STAssertNoThrow(expression, description, ...) #define STAssertNoThrowSpecific(expression, specificException, description, ...) #define STAssertNoThrowSpecificNamed(expr, specificException, aName, description, ...) #define STFail(description, ...) #define STAssertTrueNoThrow(expression, description, ...) #define STAssertFalseNoThrow(expression, description, ...)