Unit testing Core Data can be very time consuming and tedious. This is another situation where the amazing Magical Record Core Data wrapper can be helpful.
In addition to providing an Active Record style syntax for Core Data – Magical Record includes a number of Core Data helper methods including some for setting up a core data stack, and cleaning things up.
Saul Mora has created an excellent step-by-step guide demonstrating how you can use Magical Record along with a number of open source testing frameworks including the excellent aforementioned Kiwi behavioral driven testing framework, and Xcode’s built in unit testing to quickly set up Core Data unit tests.
You can find the guide on the Cocoa Is My Girlfriend Blog here.
A nice and easy guide for setting up Core Data unit tests.
©2012 iPhone, iOS 5, iPad SDK Development Tutorial and Programming Tips. All Rights Reserved.
.