mronge/MailCore — pull request #67 by NiKnight (2012-12-21 04:37:52+00:00)
Title: Fixes to MailCore tests; no hard-coding of mail account data, proper test data file access

Hey guys. I'm back with an updated and cleaner Pull Request.

Now all TestData is compiled into the Test bundle and pulled out of it when needed by the tests. The same account.plist is still recommended (and excluded by .gitignore) to specify your own mail account information for the live test.

There was one key change to the source to make the tests pass, in commit 'Fix to Core Folder tests; senderDate returns nil.' Not sure why `[NSDate distantPast]` was used instead of nil, but I changed it to what the test expected, nil. We can easily change that back and in the test if needed. `[NSDate distantPast]` just seems very weird to me.

Three tests still failing, but they seem like they might be a regression in the core functionality more than anything specific to my changes. Thoughts?
> file://localhost/Users/scottnonnenberg/Development/MailCore/Tests/CTCoreAttachmentTests.m: error: testJPEG (CTCoreAttachmentTests) failed: 'image/jpeg' should be equal to 'application/octet-stream' The content-type should have been image/jpeg
> file://localhost/Users/scottnonnenberg/Development/MailCore/Tests/CTCoreAttachmentTests.m: error: testPNG (CTCoreAttachmentTests) failed: 'image/png' should be equal to 'application/octet-stream' The content-type should have been image/png
> file://localhost/Users/scottnonnenberg/Development/MailCore/Tests/CTCoreAttachmentTests.m: error: testTIFF (CTCoreAttachmentTests) failed: 'image/tiff' should be equal to 'application/octet-stream' The content-type should have been image/TIFF