bbgo_origin/pkg/exchange/binance/exchange_test.go
2021-04-28 19:20:55 +08:00

18 lines
328 B
Go

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)
cID = newSpotClientOrderID("myid1")
assert.Equal(t, cID, "x-" + spotBrokerID + "myid1")
}