Getting OCMock to Work with XCTest

October 7th, 2013

Filed under: Xcode | 1 comment

XCTest does not currently have built-in support for mock objects so you’ll need an external framework like OCMock for mock object support. OCMock versions 2.2 and later work with XCTest. I had only one problem getting OCMock to work with XCTest. When I ran my tests, I would get a warning saying that the test […]

Xcode 5: Unit Testing Changes

September 30th, 2013

Filed under: Xcode | 6 comments

One of the biggest areas of change in Xcode 5 involves unit testing. This post details those changes. Test Navigator Xcode 5 adds a test navigator to the available navigators on the left side of the project window. You can see an example of the test navigator in the following screenshot: The test navigator has […]

Introduction to Unit Testing with OCUnit

May 23rd, 2012

Filed under: Mac Development | 3 comments

In a previous post I covered how to setup OCUnit unit testing in Xcode 4. This post provides an introduction to writing unit tests with OCUnit, which is a unit testing framework for Objective-C code that comes with Xcode. Unit Testing Classes When writing unit tests with OCUnit, you will create one or more unit […]

Setting Up OCUnit Unit Testing in Xcode 4

May 15th, 2012

Filed under: Xcode | 1 comment

Xcode ships with OCUnit, which allows you to unit test Objective-C code. This post shows you how to setup Xcode 4 so you can unit test Cocoa and iOS applications. Create an Appropriate Project The easiest way to add unit testing support in Xcode 4 is to create a project that uses the Cocoa or […]

Xcode 4.2: Application and Logic Unit Test Classes

November 30th, 2011

Filed under: Xcode | Be the first to comment!

In Xcode 4.2 when you add a new Objective-C test case class to your project and click the Next button, you will see a Test Type menu. This menu has two choices: Application and Logic. The menu determines the unit test Xcode adds in the class’s implementation file. If you choose Application, Xcode adds a […]