mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-09 07:26:48 +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:
@@ -93,7 +93,7 @@ func TestIsEvent(t *testing.T) {
|
||||
func TestPair(t *testing.T) {
|
||||
t.Parallel()
|
||||
e := &Base{
|
||||
CurrencyPair: currency.NewPair(currency.BTC, currency.USDT),
|
||||
CurrencyPair: currency.NewBTCUSDT(),
|
||||
}
|
||||
y := e.Pair()
|
||||
if y.IsEmpty() {
|
||||
@@ -148,7 +148,7 @@ func TestGetBase(t *testing.T) {
|
||||
func TestGetUnderlyingPair(t *testing.T) {
|
||||
t.Parallel()
|
||||
b1 := &Base{
|
||||
UnderlyingPair: currency.NewPair(currency.BTC, currency.USDT),
|
||||
UnderlyingPair: currency.NewBTCUSDT(),
|
||||
}
|
||||
if !b1.UnderlyingPair.Equal(b1.GetUnderlyingPair()) {
|
||||
t.Errorf("expected '%v' received '%v'", b1.UnderlyingPair, b1.GetUnderlyingPair())
|
||||
|
||||
@@ -44,7 +44,7 @@ func TestIsEmpty(t *testing.T) {
|
||||
t.Parallel()
|
||||
o := Order{
|
||||
Base: &event.Base{
|
||||
CurrencyPair: currency.NewPair(currency.BTC, currency.USDT),
|
||||
CurrencyPair: currency.NewBTCUSDT(),
|
||||
},
|
||||
}
|
||||
y := o.CurrencyPair
|
||||
@@ -130,7 +130,7 @@ func TestGetSellLimit(t *testing.T) {
|
||||
|
||||
func TestPair(t *testing.T) {
|
||||
t.Parallel()
|
||||
cp := currency.NewPair(currency.BTC, currency.USDT)
|
||||
cp := currency.NewBTCUSDT()
|
||||
k := Order{
|
||||
Base: &event.Base{
|
||||
CurrencyPair: cp,
|
||||
|
||||
Reference in New Issue
Block a user