public
Description: An evolving collection of unit tests I've been writing as I learn Objective-C and Cocoa.
Homepage: http://clarkware.com
Clone URL: git://github.com/clarkware/cocoa-learning-tests.git
name age message
file .gitignore Fri Apr 03 11:39:36 -0700 2009 Initial import. [clarkware]
directory Classes/ Tue Apr 21 06:22:05 -0700 2009 Going back to the tried and true init pattern. [clarkware]
directory CocoaLearningTests.xcodeproj/ Fri Apr 03 11:39:36 -0700 2009 Initial import. [clarkware]
file CocoaLearningTests_Prefix.pch Fri Apr 03 11:39:36 -0700 2009 Initial import. [clarkware]
directory English.lproj/ Fri Apr 03 11:39:36 -0700 2009 Initial import. [clarkware]
file Info.plist Fri Apr 03 11:39:36 -0700 2009 Initial import. [clarkware]
file README.md Tue Apr 21 06:22:05 -0700 2009 Going back to the tried and true init pattern. [clarkware]
file Rakefile Fri Apr 03 11:39:36 -0700 2009 Initial import. [clarkware]
file Tests-Info.plist Fri Apr 03 11:39:36 -0700 2009 Initial import. [clarkware]
directory Tests/ Sat Aug 29 10:33:00 -0700 2009 Update for Mac OS X 10.6. [clarkware]
file main.m Sat Aug 29 10:33:00 -0700 2009 Update for Mac OS X 10.6. [clarkware]
file version.plist Fri Apr 03 11:39:36 -0700 2009 Initial import. [clarkware]
README.md

Cocoa Learning Tests

An evolving collection of unit tests I've been writing as I learn Objective-C and Cocoa. It's a work in progress I started years ago. These tests are the safe place I return to when I get stuck, or when I need to better understand methods or APIs I intend to use in production code. I used a similar learning style when I learned Ruby, as described in this blog post.

The goal isn't to create a comprehensive test suite for Objective-C or Cocoa. I'm not trying to verify whether they work as advertised. Rather, I'm writing these tests to learn how things actually work. It's learning through exploration. Once nice side effect is winding up with an executable repository of knowledge; the test suite grows each time I learn something new.

If you're new to Objective-C, I hope you learn something interesting by reading through these tests. But you'll likely learn a lot more by writing tests to poke and prod language features you want to use. So please, by all means, fork these tests and make them your own!

About the Tests

This Xcode project makes use of the SenTest testing framework included in Xcode. You might want to start by having a look at AssertionsTests.m. It shows how all the common assertion macros work. In some of the tests I have duplicated initialization code. I'm ok with that.

To run the tests in Xcode, select the "Tests" target and build it. To run the tests from the command line, run "rake".

Author

Mike Clark, mike@clarkware.com, Clarkware Consulting