mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-14 07:26:47 +00:00
* Tests: Use currency.NewUSD and NewUSDT Simple refactor to use the provided shortcut methods * Github: Add CI check to ensure NewPair not used Add a step to ensure NewPair(BTC, USD*) isn't used
31 lines
548 B
Go
31 lines
548 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/thrasher-corp/gocryptotrader/currency"
|
|
)
|
|
|
|
func TestDisruptFormatting(t *testing.T) {
|
|
_, err := disruptFormatting(currency.EMPTYPAIR)
|
|
if err == nil {
|
|
t.Fatal("error cannot be nil")
|
|
}
|
|
|
|
_, err = disruptFormatting(currency.Pair{Quote: currency.BTC})
|
|
if err == nil {
|
|
t.Fatal("error cannot be nil")
|
|
}
|
|
|
|
p := currency.NewBTCUSDT()
|
|
|
|
badPair, err := disruptFormatting(p)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
if badPair.String() != "BTC-TEST-DELIM-usdt" {
|
|
t.Fatal("incorrect disrupted pair")
|
|
}
|
|
}
|