I got confused by a strange problem that I have not encountered before.
When you execute cmd + U to run unit tests (e.g. OCUnit), does it really call main.m, the new appDelegate and launch the application, as if you had pressed cmd + R?
I am only asking because I am using CoreData for this DataLayer. I mock the DataLayer in my tests, but as soon as I apply the getAll method, which actually calls CoreData, the / xcode application throws an exception from the managed object model, it cannot be nil. Which I understand, but I do not actually mean the new DataLayer class, and I set a breakpoint in my loadView method mainviewcontroller, where it calls the DataLayer getAll method. It doesn't matter in the tests, because it's a layout, but it seems to be calling the real instance.
So, back to my question, when pressing cmd + U does it also launch the application and then run the tests?
ios iphone unit-testing xcode
Mark W Mar 30 '13 at 3:38 am
source share