bbgo_origin/pkg/exchange/binance/exchange_test.go

18 lines
322 B
Go
Raw Permalink Normal View History

2021-04-28 11:20:55 +00:00
package binance
import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
)
func Test_newClientOrderID(t *testing.T) {
cID := newSpotClientOrderID("")
assert.Len(t, cID, 32)
strings.HasPrefix(cID, "x-"+spotBrokerID)
2021-04-28 11:20:55 +00:00
cID = newSpotClientOrderID("myid1")
assert.Equal(t, cID, "x-"+spotBrokerID+"myid1")
2021-04-28 11:20:55 +00:00
}