1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 17:47:03 +00:00

corrected tests

This commit is contained in:
Tomasz Wojtuń
2016-09-01 17:25:24 +02:00
committed by James Hillyerd
parent 124f830478
commit 02eee0a608
6 changed files with 39 additions and 1 deletions

View File

@@ -17,6 +17,7 @@ import (
type InputMessageData struct {
Mailbox, ID, From, Subject string
To string
Date time.Time
Size int
Header mail.Header
@@ -27,6 +28,7 @@ func (d *InputMessageData) MockMessage() *MockMessage {
msg := &MockMessage{}
msg.On("ID").Return(d.ID)
msg.On("From").Return(d.From)
msg.On("To").Return(d.To)
msg.On("Subject").Return(d.Subject)
msg.On("Date").Return(d.Date)
msg.On("Size").Return(d.Size)
@@ -79,6 +81,9 @@ func (d *InputMessageData) CompareToJSONHeaderMap(json interface{}) (errors []st
if msg, ok := isJSONStringEqual(fromKey, d.From, m[fromKey]); !ok {
errors = append(errors, msg)
}
if msg, ok := isJSONStringEqual(toKey, d.To, m[toKey]); !ok {
errors = append(errors, msg)
}
if msg, ok := isJSONStringEqual(subjectKey, d.Subject, m[subjectKey]); !ok {
errors = append(errors, msg)
}