mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
Add exchange GetAvailableCurrencies function
This commit is contained in:
@@ -85,6 +85,12 @@ func (e *Base) GetEnabledCurrencies() []string {
|
||||
return e.EnabledPairs
|
||||
}
|
||||
|
||||
// GetAvailableCurrencies is a method that returns the available currency pairs
|
||||
// of the exchange base
|
||||
func (e *Base) GetAvailableCurrencies() []string {
|
||||
return e.AvailablePairs
|
||||
}
|
||||
|
||||
// FormatCurrency is a method that formats and returns a currency pair
|
||||
// based on the user currency display preferences
|
||||
func FormatCurrency(p pair.CurrencyPair) pair.CurrencyItem {
|
||||
|
||||
@@ -32,6 +32,19 @@ func TestGetEnabledCurrencies(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetAvailableCurrencies(t *testing.T) {
|
||||
availablePairs := []string{"BTCUSD", "BTCAUD", "LTCUSD", "LTCAUD"}
|
||||
GetEnabledCurrencies := Base{
|
||||
Name: "TESTNAME",
|
||||
AvailablePairs: availablePairs,
|
||||
}
|
||||
|
||||
enCurr := GetEnabledCurrencies.GetAvailableCurrencies()
|
||||
if enCurr[0] != "BTCUSD" {
|
||||
t.Error("Test Failed - Exchange GetAvailableCurrencies() incorrect string")
|
||||
}
|
||||
}
|
||||
|
||||
func TestFormatCurrency(t *testing.T) {
|
||||
cfg := config.GetConfig()
|
||||
err := cfg.LoadConfig(config.ConfigTestFile)
|
||||
|
||||
Reference in New Issue
Block a user