add test for binance new function

This commit is contained in:
zenix.huang 2024-03-12 15:57:22 +09:00
parent f1a4879253
commit 465e7d8983

View File

@ -1,6 +1,7 @@
package binance
import (
"context"
"strings"
"testing"
@ -15,3 +16,12 @@ func Test_newClientOrderID(t *testing.T) {
cID = newSpotClientOrderID("myid1")
assert.Equal(t, cID, "x-"+spotBrokerID+"myid1")
}
func Test_new(t *testing.T) {
ex := New("", "")
assert.NotEmpty(t, ex)
ctx := context.Background()
ticker, err := ex.QueryTicker(ctx, "btcusdt")
assert.NotEmpty(t, ticker)
assert.NoError(t, err)
}