-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbanks_test.go
More file actions
39 lines (33 loc) · 875 Bytes
/
banks_test.go
File metadata and controls
39 lines (33 loc) · 875 Bytes
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
package igcclient
/*
func TestBanksService_Banks(t *testing.T) {
teardown := setup()
defer teardown()
mux.HandleFunc("/banks", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(200)
w.Write([]byte("{\"Data\":[{\"BankId\":1},{\"BankId\":2}],\"Success\":true,\"Errors\":[]}"))
})
countries, err := client.Banks.Banks()
if err != nil {
t.Errorf(err.Error())
}
if len(*countries.Data) != 2 {
t.Errorf("Expected 2 banks")
}
}
func TestBanksService_BankByID(t *testing.T) {
teardown := setup()
defer teardown()
mux.HandleFunc("/banks/1", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(200)
w.Write([]byte("{\"Data\":{\"BankId\":1},\"Success\":true,\"Errors\":[]}"))
})
country, err := client.Banks.BankByID(1)
if err != nil {
t.Errorf(err.Error())
}
if *country.Data.BankID != 1 {
t.Errorf("BankID is not 1")
}
}
*/