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

Function TestFormatExchangeCurrencies

exchanges/exchange_test.go:695–726  ·  view source on GitHub ↗

TestFormatExchangeCurrencies exercises FormatExchangeCurrencies

(t *testing.T)

Source from the content-addressed store, hash-verified

693
694// TestFormatExchangeCurrencies exercises FormatExchangeCurrencies
695func TestFormatExchangeCurrencies(t *testing.T) {
696 t.Parallel()
697
698 e := Base{
699 CurrencyPairs: currency.PairsManager{
700 UseGlobalFormat: true,
701
702 RequestFormat: &currency.PairFormat{
703 Uppercase: false,
704 Delimiter: "~",
705 Separator: "^",
706 },
707
708 ConfigFormat: &currency.PairFormat{
709 Uppercase: true,
710 Delimiter: "_",
711 },
712 },
713 }
714
715 pairs := []currency.Pair{
716 currency.NewPairWithDelimiter("BTC", "USD", "_"),
717 currency.NewPairWithDelimiter("LTC", "BTC", "_"),
718 }
719
720 got, err := e.FormatExchangeCurrencies(pairs, asset.Spot)
721 require.NoError(t, err)
722 assert.Equal(t, "btc~usd^ltc~btc", got)
723
724 _, err = e.FormatExchangeCurrencies(nil, asset.Spot)
725 assert.ErrorContains(t, err, "returned empty string", "FormatExchangeCurrencies should error correctly")
726}
727
728func TestFormatExchangeCurrency(t *testing.T) {
729 t.Parallel()

Callers

nothing calls this directly

Calls 3

NewPairWithDelimiterFunction · 0.92
EqualMethod · 0.45

Tested by

no test coverage detected