bbgo_origin/pkg/exchange/max/ticker_test.go

42 lines
917 B
Go
Raw Normal View History

2021-02-06 17:35:23 +00:00
package max
import (
"context"
"testing"
2021-02-07 21:58:30 +00:00
"github.com/stretchr/testify/assert"
2021-02-06 17:35:23 +00:00
)
func TestAllSymbols(t *testing.T) {
e := New("mock_key", "mock_secret")
got, err := e.QueryTickers(context.Background())
2021-02-07 21:58:30 +00:00
assert.NoError(t, err)
2021-02-06 17:35:23 +00:00
if len(got) <= 1 {
t.Errorf("Max Exchange: Attempting to get all symbol tickers, but get 1 or less")
}
}
func TestSomeSymbols(t *testing.T) {
e := New("mock_key", "mock_secret")
got, err := e.QueryTickers(context.Background(), "BTCUSDT", "ETHUSDT")
2021-02-07 21:58:30 +00:00
assert.NoError(t, err)
2021-02-06 17:35:23 +00:00
if len(got) != 2 {
t.Errorf("Max Exchange: Attempting to get two symbols, but number of tickers do not match")
}
}
func TestSingleSymbol(t *testing.T) {
e := New("mock_key", "mock_secret")
got, err := e.QueryTickers(context.Background(), "BTCUSDT")
2021-02-07 21:58:30 +00:00
assert.NoError(t, err)
2021-02-06 17:35:23 +00:00
if len(got) != 1 {
t.Errorf("Max Exchange: Attempting to get one symbol, but number of tickers do not match")
}
}