Re: Dumb question about unit testing
Re: Dumb question about unit testing
- Subject: Re: Dumb question about unit testing
- From: Sean McBride <email@hidden>
- Date: Mon, 19 Nov 2012 13:18:30 -0500
- Organization: Rogue Research Inc.
On Sun, 18 Nov 2012 21:26:09 -0600, William Squires said:
>What's the recommended procedure for (unit) testing the initWithCoder:
>and encodeWithCoder: methods of a class that conforms to NSCoding protocol?
I do two things: 1) a test that encodes then immediately decodes, then compares the original with the copy. 2) I create files on disk with serialized data, then build new objects from them by deserializing. If/when your format changes, you then have a collection of old formats to test too.
Cheers,
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden