mronge/MailCore — pull request #42 by NiKnight (2012-09-14 19:48:55+00:00)
Title: Refactored tests building/passing, time zone bugs fixed, htmlBody bug fixed

Three major categories of changes in this pull request:

1) tests are now building and passing, and hardcoded paths and credentials have been eliminated Details:
- Build failure fixed - bodyPreferringPlainText now required a *BOOL parameter, so passing it in and checking the result in each CTCoreFolderTest test
- New account.plist added to allow user to provide their own account information for testing
- Hardcoded paths removed - tests now rely on relative paths
- TestData added to project

2) Timezone bugs in CTCoreMessage
All timezone-related manipulation in CTCoreMessage has been removed, as NSDates do not have time zones. Timezones are a figment of an NSDateFormatter's imagination, and therefore sentDateGMT, senderDate and setDateLocalTimeZone all now return the same NSDate.

3) htmlBody now calls fetchBodyStructure if needed
The body accessor for plain text checks to see if myFields or myParsedMime are null, and if so calls fetchBodyStructure. Copied this code into htmlBody. Also added a convenience method useful to those who want HTML first: bodyPreferringHTML.

Misc:
- files in the TestData directory are included in the project. This makes it a bit easier to work with them while writing and debugging tests. They are not included in any build target, nor is the new account.plist in the same directory.
- README.md has been updated to give some information on how to run MailCore tests.
- .gitignore updated to exclude user's account.plist, which will contain their email account's credentials
- added a new test file with no plain text element, and two tests using it - one CTCoreMessage test, and one CTMIMETest