mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-16 03:53:52 +00:00
32 lines
578 B
Go
32 lines
578 B
Go
package core
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/c9s/bbgo/pkg/types"
|
|
)
|
|
|
|
func TestSymbolConverter(t *testing.T) {
|
|
converter := NewSymbolConverter("MAXEXCHANGEUSDT", "MAXUSDT")
|
|
trade, err := converter.ConvertTrade(types.Trade{
|
|
Symbol: "MAXEXCHANGEUSDT",
|
|
})
|
|
|
|
if assert.NoError(t, err) {
|
|
assert.Equal(t, "MAXUSDT", trade.Symbol)
|
|
}
|
|
|
|
order, err := converter.ConvertOrder(types.Order{
|
|
SubmitOrder: types.SubmitOrder{
|
|
Symbol: "MAXEXCHANGEUSDT",
|
|
},
|
|
})
|
|
|
|
if assert.NoError(t, err) {
|
|
assert.Equal(t, "MAXUSDT", order.Symbol)
|
|
}
|
|
|
|
}
|