I am going to try and use the new testing features in Xcode 7 (code coverage) and Swift 2.0.
Using code coverage, I see that I am not testing my NSCoding
methods.
For a trivial example of saving a few details, such as:
required init(coder aDecoder: NSCoder) {
name = aDecoder.decodeObjectForKey("name") as! String
time = aDecoder.decodeIntegerForKey("time")
}
func encodeWithCoder(aCoder: NSCoder) {
aCoder.encodeInteger(time, forKey: "time")
aCoder.encodeObject(name, forKey: "name")
}
How do I go about testing these methods in an XCTest
class.