Skip to content
forked from c9s/bbgo

Commit

Permalink
core: add TestSymbolConverter
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Aug 8, 2024
1 parent 00e860d commit df8d52a
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions pkg/core/converter_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
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)
}

}

0 comments on commit df8d52a

Please sign in to comment.