Fixes to MailCore tests; no hard-coding of mail account data, proper test data file access #67
Conversation
Instead of hardcoding it. Excluded from the repository via .gitignore. Also adding TestData to the project, compiled into the Test bundle. Pushing the iOS deployment target down to 4.3, and ensuring that all projects have the same value there.
sentDateGMT has been removed, changing to senderDate. Also, changing from bodyPreferringPlainText to just body - the former required an out parameter that was not being provided.
Because in the newest simulators, your current working directory is more like it is in when you're on the phone itself. Also no need for the filePrefix var any longer.
testSentDate wasn't quite passing: sentDateGMT has been removed and the number of seconds representing the date the email was sent is not what was there before. Fixed. Also, we needed to pull the message files out of the test bundle.
Noticed that this change was necessary to get all Core Folder tests passing. Those tests expected senderDate to return nil if there was no message loaded.
It calls fetchBodyStructure if myFields or myParsedMIME is null, just like .body does. Two new tests added; the change to htmlBody is required to get them both to pass.
mronge
added a commit
that referenced
this pull request
Jan 23, 2013
Fixes to MailCore tests; no hard-coding of mail account data, proper test data file access
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
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?