-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevaluations_test.go
57 lines (50 loc) · 1.31 KB
/
evaluations_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
package rize_test
import (
"context"
"net/http"
"testing"
"time"
"github.com/rizefinance/rize-go-sdk"
)
// Complete Evaluation{} response data
var evaluation = &rize.Evaluation{
UID: "EhrQZJNjCd79LLYq",
Outcome: "approved",
CreatedAt: time.Now(),
Flags: &rize.EvaluationFlag{
DocumentQualityCheck: true,
FraudCheck: true,
FinancialCheck: true,
WatchListCheck: true,
},
PIIMatch: &rize.EvaluationPIIMatch{
DOBMatch: true,
SSNMatch: true,
NameMatch: true,
EmailMatch: true,
PhoneMatch: true,
AddressMatch: true,
},
}
func TestEvaluationService_List(t *testing.T) {
params := &rize.EvaluationListParams{
CustomerUID: "uKxmLxUEiSj5h4M3",
Latest: true,
}
resp, err := rc.Evaluations.List(context.Background(), params)
if err != nil {
t.Fatal("Error fetching Evaluations\n", err)
}
if err := validateSchema(http.MethodGet, "/evaluations", http.StatusOK, params, nil, resp); err != nil {
t.Fatalf(err.Error())
}
}
func TestEvaluationService_Get(t *testing.T) {
resp, err := rc.Evaluations.Get(context.Background(), "EhrQZJNjCd79LLYq")
if err != nil {
t.Fatal("Error fetching Evaluation\n", err)
}
if err := validateSchema(http.MethodGet, "/evaluations/{uid}", http.StatusOK, nil, nil, resp); err != nil {
t.Fatalf(err.Error())
}
}