forked from diogogmt/go-emailacid
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathemail_test.go
64 lines (56 loc) · 1.37 KB
/
email_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
52
53
54
55
56
57
58
59
60
61
62
63
64
package emailacid_test
import (
"testing"
emailacid "github.com/pressly/go-emailacid"
)
func TestEmail(t *testing.T) {
t.Parallel()
t.Run("createTest", testEmailCreateTest)
t.Run("listTests", testEmailCreateTest)
t.Run("getTestInfo", testEmailGetTestInfo)
t.Run("getTestClientResult", testGetTestClientResult)
t.Run("listTestClientResults", testListTestClientResults)
}
func testEmailCreateTest(t *testing.T) {
in := &emailacid.EmailTest{
Subject: "test",
HTML: "<html><body>testing...</body></html>",
TransferEncoding: "8bit",
Charset: "utf-8",
ReferenceID: "12345ABC",
CustomerID: "2",
Clients: EmailAcidClient.ClientTypes,
}
_, err := EmailAcidClient.CreateTest(in)
if err != nil {
t.Fatal(err)
}
}
func testEmailListTests(t *testing.T) {
_, err := EmailAcidClient.ListTests()
if err != nil {
t.Fatal(err)
}
}
func testEmailGetTestInfo(t *testing.T) {
testID := "sandbox"
_, err := EmailAcidClient.GetTestInfo(testID)
if err != nil {
t.Fatal(err)
}
}
func testGetTestClientResult(t *testing.T) {
testID := "sandbox"
clientID := "outlook03"
_, err := EmailAcidClient.GetTestClientResult(testID, clientID)
if err != nil {
t.Fatal(err)
}
}
func testListTestClientResults(t *testing.T) {
testID := "sandbox"
_, err := EmailAcidClient.ListTestClientResults(testID)
if err != nil {
t.Fatal(err)
}
}