mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 15:09:42 +00:00
Tests: Use currency.NewBTCUSD and NewBTCUSDT (#1895)
* 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
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
func TestMatchesExchangeAsset(t *testing.T) {
|
||||
t.Parallel()
|
||||
cp := currency.NewPair(currency.BTC, currency.USD)
|
||||
cp := currency.NewBTCUSD()
|
||||
k := ExchangePairAsset{
|
||||
Exchange: "test",
|
||||
Base: cp.Base.Item,
|
||||
@@ -33,7 +33,7 @@ func TestMatchesExchangeAsset(t *testing.T) {
|
||||
|
||||
func TestMatchesPairAsset(t *testing.T) {
|
||||
t.Parallel()
|
||||
cp := currency.NewPair(currency.BTC, currency.USD)
|
||||
cp := currency.NewBTCUSD()
|
||||
k := ExchangePairAsset{
|
||||
Base: cp.Base.Item,
|
||||
Quote: cp.Quote.Item,
|
||||
@@ -48,7 +48,7 @@ func TestMatchesPairAsset(t *testing.T) {
|
||||
if k.MatchesPairAsset(currency.EMPTYPAIR, asset.Futures) {
|
||||
t.Error("expected false")
|
||||
}
|
||||
if k.MatchesPairAsset(currency.NewPair(currency.BTC, currency.USDT), asset.Spot) {
|
||||
if k.MatchesPairAsset(currency.NewBTCUSDT(), asset.Spot) {
|
||||
t.Error("expected false")
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,7 @@ func TestMatchesExchange(t *testing.T) {
|
||||
|
||||
func TestExchangePairAsset_Pair(t *testing.T) {
|
||||
t.Parallel()
|
||||
cp := currency.NewPair(currency.BTC, currency.USD)
|
||||
cp := currency.NewBTCUSD()
|
||||
k := ExchangePairAsset{
|
||||
Base: currency.BTC.Item,
|
||||
Quote: currency.USD.Item,
|
||||
@@ -93,7 +93,7 @@ func TestExchangePairAsset_Pair(t *testing.T) {
|
||||
|
||||
func TestPairAsset_Pair(t *testing.T) {
|
||||
t.Parallel()
|
||||
cp := currency.NewPair(currency.BTC, currency.USD)
|
||||
cp := currency.NewBTCUSD()
|
||||
k := PairAsset{
|
||||
Base: currency.BTC.Item,
|
||||
Quote: currency.USD.Item,
|
||||
|
||||
Reference in New Issue
Block a user