-
Notifications
You must be signed in to change notification settings - Fork 2
/
ewallet-admin_test.go
69 lines (60 loc) · 1.35 KB
/
ewallet-admin_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
65
66
67
68
69
package omisego_test
import (
omg "github.com/Alainy/OmiseGo-Go-SDK"
"github.com/icrowley/fake"
"net/url"
"testing"
)
var (
accessKey = "dqG1xQec9uWRCSUyg70zWZ_MFYKXc5n1vBVNzajejBw"
secretKey = "4yd0m3eFR9yWO3niEnTUodM0ZfSg0KsKkRSbwK1U4_J_SY3IdCEbDcUsADm2-X1VVulFyVPfcli7wMX5NJsgY0mzg6VTd8ul9isAbVoEomGl0TwENPRCUnC444CSEpyyCthHf7CFaMitCbc2f0KK0lQxarAkkLRlfL-EAmLYiAg"
adminURL = &url.URL{
Scheme: "http",
Host: "localhost:4000",
Path: "/api/admin",
}
)
func TestAdminAll(t *testing.T) {
c, _ := omg.NewClient(accessKey, secretKey, adminURL)
adminClient := omg.AdminAPI{
Client: c,
}
body := omg.ListParams{}
res, err := adminClient.AdminAll(body)
t.Log(res)
if err != nil {
t.Fatal(err)
}
}
func TestUserCreate(t *testing.T) {
c, _ := omg.NewClient(accessKey, secretKey, adminURL)
adminClient := omg.AdminAPI{
Client: c,
}
body := omg.UserParams{
fake.UserName(),
fake.EmailAddress(),
map[string]interface{}{
"first_name": fake.FirstName(),
"last_name": fake.LastName(),
},
nil,
}
res, err := adminClient.UserCreate(body)
t.Log(res)
if err != nil {
t.Fatal(err)
}
}
func TestUserAll(t *testing.T) {
c, _ := omg.NewClient(accessKey, secretKey, adminURL)
adminClient := omg.AdminAPI{
Client: c,
}
body := omg.ListParams{}
res, err := adminClient.UserAll(body)
t.Log(res)
if err != nil {
t.Fatal(err)
}
}