views:

78

answers:

1

Hi,

I'm trying to set up my unit testing for an iPhone application using XCode 3.2.3.

I followed the steps in http://developer.apple.com/iphone/library/documentation/xcode/conceptual/iphone_development/135-Unit_Testing_Applications/unit_testing_applications.html

As closely as I could, but I am getting this error message upon trying to build: "((yourApplicationDelegate) != nil)" should be true. UIApplication failed to find the AppDelegate

(this being the default trivial test for USE APPLICATION UNIT TEST is true)

I am building my app test target, as is discussed in the documentation, and get this error.

Do I need to ensure all my non-test case source is in my test bundle?

confused

--

I included the source files into my project and it compiles fine, but it still suffers the same unit test error:

"((yourApplicationDelegate) != nil)" should be true. UIApplication failed to find the AppDelegate

The original code is the same as the template code:

-(void) testAppDelegate {

    id yourApplicationDelegate = [[UIApplication sharedApplication] delegate];
    STAssertNotNil(yourApplicationDelegate, @"UIApplication failed to find the AppDelegate");
}
A: 

Take a look at this article

http://blazingcloud.net/2010/02/20/test-driven-development-for-iphone/

Seann
This deals with the logic tests, which I have gotten successfully functional and works fine. It's the application test, which the blog says they will cover later. The link in the article points back to the apple documentation which I followed originally.
groundhog