mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
add test for types.ExchangeName
This commit is contained in:
parent
465e7d8983
commit
d4eef3e3f9
17
pkg/types/exchange_test.go
Normal file
17
pkg/types/exchange_test.go
Normal file
|
@ -0,0 +1,17 @@
|
|||
package types
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func Test_exchangeName(t *testing.T) {
|
||||
assert.Equal(t, ExchangeMax.String(), "max")
|
||||
name, err := ValidExchangeName("binance")
|
||||
assert.Equal(t, name, ExchangeName("binance"))
|
||||
assert.NoError(t, err)
|
||||
_, err = ValidExchangeName("dummy")
|
||||
assert.Error(t, err)
|
||||
assert.True(t, ExchangeMax.IsValid())
|
||||
}
|
Loading…
Reference in New Issue
Block a user