MCPcopy
hub / github.com/thrasher-corp/gocryptotrader / TestFormatSymbol

Function TestFormatSymbol

exchanges/exchange_test.go:1667–1684  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1665}
1666
1667func TestFormatSymbol(t *testing.T) {
1668 b := Base{}
1669 spotStore := currency.PairStore{
1670 RequestFormat: &currency.PairFormat{Uppercase: true},
1671 ConfigFormat: &currency.PairFormat{
1672 Delimiter: currency.DashDelimiter,
1673 Uppercase: true,
1674 },
1675 }
1676 err := b.SetAssetPairStore(asset.Spot, spotStore)
1677 require.NoError(t, err, "SetAssetPairStore must not error")
1678 p := currency.NewBTCUSD().Format(*spotStore.ConfigFormat)
1679 sym, err := b.FormatSymbol(p, asset.Spot)
1680 require.NoError(t, err, "FormatSymbol must not error")
1681 assert.Equal(t, "BTCUSD", sym, "FormatSymbol should format the pair correctly")
1682 _, err = b.FormatSymbol(p, asset.Futures)
1683 assert.ErrorIs(t, err, asset.ErrNotSupported)
1684}
1685
1686func TestSetAPIURL(t *testing.T) {
1687 b := Base{

Callers

nothing calls this directly

Calls 5

SetAssetPairStoreMethod · 0.95
FormatSymbolMethod · 0.95
NewBTCUSDFunction · 0.92
FormatMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected