Automated testing (unit/integration/functional testing) is a really great way to verify your app works as expected. Also, having confidence that your refactoring won’t break anything is totally cool too. I’ve been doing some tests with CoreData entities and stumbled on a weird exception when simply fetching them.
1 2 3 4 5 6
Here’s the exception I got in the test:
1 2 3 4 5
No error, just exception.
I couldn’t find an answer on the internets. After a while I setup a breakpoint on
Create Exception Breakpoint. Seeing
-[_NSKeyedUnarchiveFromDataTransformer transformedValue:] in the stack trace hinted me that one of the entities has a
Transformable attribute with a certain class that wasn’t included in the test target. Adding it fixed the problem. Or better yet, create a mock class that simply returns the input value to minimize the application logic in the tests.