-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreport_test.go
54 lines (49 loc) · 1.15 KB
/
report_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
package main
import (
"errors"
"testing"
)
func TestReportGenerateTable(t *testing.T) {
t.Skip()
testSuites := []testSuiteReport{
{
PathName: "/users/{id}",
Operation: "GET",
Description: "[POS] Should return success",
Status: testResultPassed,
},
{
PathName: "/users/{id}",
Operation: "PATCH",
Description: "[POS] Should also be successful",
Status: testResultPassed,
},
{
PathName: "/users",
Operation: "PUT",
Description: "[NEG] Should return error because of BANK_LINKING_ERROR",
Status: testResultFailed,
ResultDetails: resultDetails{
HTTPStatusCodes: actualExpectStatusCodes{
Expected: 200,
Actual: 400,
},
Body: actualExpectBody{
Expected: `{"status": "ok"}`,
Actual: `{"status": "failed"}`,
},
},
},
{
PathName: "/users",
Operation: "POST",
Description: "[NEG] Should return error because of BANK_LINKING_ERROR",
Status: testResultFailed,
Err: errors.New("ECONNREFUSED: dial tcp 127.0.0.1:3002: connect: connection refused"),
},
}
report := Report{
TestSuites: testSuites,
}
report.generate()
}