| 80 | } |
| 81 | |
| 82 | func TestToString(t *testing.T) { |
| 83 | msg := &sender.Message{ |
| 84 | Subject: "Test Subject", |
| 85 | Headers: map[string]string{ |
| 86 | "Header1": "Value1", |
| 87 | "Header2": "Value2", |
| 88 | }, |
| 89 | Body: "This is the body of the message.", |
| 90 | } |
| 91 | |
| 92 | expected := "Subject: Test Subject\nHeader1: Value1\nHeader2: Value2\n\nThis is the body of the message." |
| 93 | actual := msg.ToString() |
| 94 | |
| 95 | if actual != expected { |
| 96 | t.Errorf("ToString() = %v, want %v", actual, expected) |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | func TestValidateMessageFormatAndSetDefault(t *testing.T) { |
| 101 | var f string |