mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-08 15:11:07 +00:00
Add currency pair display method to display a currency pair based on user config preferences (e.g BTC-USD or BTCUSD)
This commit is contained in:
@@ -3,6 +3,8 @@ package exchange
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/thrasher-/gocryptotrader/currency/pair"
|
||||
|
||||
"github.com/thrasher-/gocryptotrader/config"
|
||||
)
|
||||
|
||||
@@ -30,6 +32,22 @@ func TestGetEnabledCurrencies(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestFormatCurrency(t *testing.T) {
|
||||
cfg := config.GetConfig()
|
||||
err := cfg.LoadConfig(config.ConfigTestFile)
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to load config file. Error: %s", err)
|
||||
}
|
||||
|
||||
currency := pair.NewCurrencyPair("btc", "usd")
|
||||
expected := "BTC-USD"
|
||||
actual := FormatCurrency(currency).String()
|
||||
if actual != expected {
|
||||
t.Errorf("Test failed - Exchange TestFormatCurrency %s != %s",
|
||||
actual, expected)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSetEnabled(t *testing.T) {
|
||||
SetEnabled := Base{
|
||||
Name: "TESTNAME",
|
||||
|
||||
Reference in New Issue
Block a user