• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Dumb question about unit testing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Dumb question about unit testing
      • From: William Squires <email@hidden>
References: 
 >Dumb question about unit testing (From: William Squires <email@hidden>)

  • Prev by Date: Re: NSMapTable thread safety (with with ARC and weak objects)
  • Next by Date: Re: Getting notified of any change to a specific NSManagedObject?
  • Previous by thread: Dumb question about unit testing
  • Next by thread: Re: Dumb question about unit testing
  • Index(es):
    • Date
    • Thread