From 465e7d8983d184b582eee49b0983df0e693db16d Mon Sep 17 00:00:00 2001 From: "zenix.huang" Date: Tue, 12 Mar 2024 15:57:22 +0900 Subject: [PATCH] add test for binance new function --- pkg/exchange/binance/exchange_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/exchange/binance/exchange_test.go b/pkg/exchange/binance/exchange_test.go index bca405a82..e757d883c 100644 --- a/pkg/exchange/binance/exchange_test.go +++ b/pkg/exchange/binance/exchange_test.go @@ -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) +}