go-smtp-mock
go-smtp-mock copied to clipboard
[FEATURE] Easy asserts for mail data
New feature request checklist
- [x] I have updated
go-smtp-mockto the latest version - [x] I have read the Contribution Guidelines
- [x] I have read the documentation
- [x] I have searched for existing GitHub issues
Feature description
When testing an email delivery, I also want to be sure, that the inner things of an email are correct. For this I am currently missing the suitable getters.
I would like to test
Content Type (text/plain or text/html)
assert.Equal(t, "text/html", server.Messages()[0].ContentType())
Content contains a certain string
assert.Contains(t, "Sample text", server.Messages()[0].Content())
Subject is/contains a certain string
assert.Contains(t, "Example", server.Messages()[0].Subject())
assert.Equals(t, "Example", server.Messages()[0].Subject())