-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmockSender_test.go
51 lines (46 loc) · 988 Bytes
/
mockSender_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package mailsender
import (
"testing"
)
func TestMockSender_SendPlain(t *testing.T) {
var ms MockPlainSender
ms.MockSuccess = true
s := ms.GetNew()
var m Mailer
m.SenderAddress = "[email protected]"
m.Recipients = []string{"[email protected]"}
m.Subject = "Test Mail"
m.Body = "This is only a test."
suc := s.SendMail(&m)
if !suc {
t.Fail()
}
}
func TestMockSender_SendSecure(t *testing.T) {
var ms MockSecureSender
ms.MockSuccess = true
s := ms.GetNew()
var m Mailer
m.SenderAddress = "[email protected]"
m.Recipients = []string{"[email protected]"}
m.Subject = "Test Mail"
m.Body = "This is only a test."
suc := s.SendMail(&m)
if !suc {
t.Fail()
}
}
func TestMockSender_SendOfice365(t *testing.T) {
var ms Mock365Sender
ms.MockSuccess = true
s := ms.GetNew()
var m Mailer
m.SenderAddress = "[email protected]"
m.Recipients = []string{"[email protected]"}
m.Subject = "Test Mail"
m.Body = "This is only a test."
suc := s.SendMail(&m)
if !suc {
t.Fail()
}
}