TestFormatExchangeCurrencies exercises FormatExchangeCurrencies
(t *testing.T)
| 693 | |
| 694 | // TestFormatExchangeCurrencies exercises FormatExchangeCurrencies |
| 695 | func TestFormatExchangeCurrencies(t *testing.T) { |
| 696 | t.Parallel() |
| 697 | |
| 698 | e := Base{ |
| 699 | CurrencyPairs: currency.PairsManager{ |
| 700 | UseGlobalFormat: true, |
| 701 | |
| 702 | RequestFormat: ¤cy.PairFormat{ |
| 703 | Uppercase: false, |
| 704 | Delimiter: "~", |
| 705 | Separator: "^", |
| 706 | }, |
| 707 | |
| 708 | ConfigFormat: ¤cy.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 | |
| 728 | func TestFormatExchangeCurrency(t *testing.T) { |
| 729 | t.Parallel() |
nothing calls this directly
no test coverage detected