-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient_test.go
More file actions
65 lines (48 loc) · 1.11 KB
/
Copy pathclient_test.go
File metadata and controls
65 lines (48 loc) · 1.11 KB
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
package crypto
import (
"testing"
)
func TestSymbols(t *testing.T) {
client := New("", "")
symbols, err := client.Symbols()
if err != nil {
t.Errorf("Symbols() failed: %v", err)
}
if len(symbols) == 0 {
t.Error("Symbols() returned an empty response")
}
t.Logf("%+v", symbols)
}
func TestTickers(t *testing.T) {
client := New("", "")
tickers, err := client.Tickers()
if err != nil {
t.Errorf("Tickers() failed: %v", err)
}
if len(tickers) == 0 {
t.Error("Tickers() returned an empty response")
}
t.Logf("%+v", tickers)
}
func TestTicker(t *testing.T) {
client := New("", "")
ticker, err := client.Ticker("ETH_BTC")
if err != nil {
t.Errorf("Ticker(\"ETH_BTC\") failed: %v", err)
}
t.Logf("%+v", ticker)
}
func TestOrderBook(t *testing.T) {
client := New("", "")
book, err := client.OrderBook("ETH_BTC")
if err != nil {
t.Errorf("OrderBook(\"ETH_BTC\") failed: %v", err)
}
if len(book.Bids) == 0 {
t.Error("OrderBook(\"ETH_BTC\").Bids returned an empty response")
}
if len(book.Asks) == 0 {
t.Error("OrderBook(\"ETH_BTC\").Asks returned an empty response")
}
t.Logf("%+v", book)
}