Skip to content

Commit

Permalink
Tests for Bitstamp TestGetTradingFees
Browse files Browse the repository at this point in the history
  • Loading branch information
gbjk committed Oct 4, 2023
1 parent 02aa4f8 commit e208134
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions exchanges/bitstamp/bitstamp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"testing"
"time"

"github.com/davecgh/go-spew/spew"
"github.com/stretchr/testify/assert"
"github.com/thrasher-corp/gocryptotrader/common"
"github.com/thrasher-corp/gocryptotrader/core"
Expand Down Expand Up @@ -158,6 +157,10 @@ func TestGetFee(t *testing.T) {
func TestGetAccountTradingFee(t *testing.T) {
t.Parallel()

if !mockTests {
sharedtestvalues.SkipTestIfCredentialsUnset(t, b)
}

fee, err := b.GetAccountTradingFee(context.Background(), currency.NewPair(currency.LTC, currency.BTC))
assert.NoError(t, err, "GetAccountTradingFee should not error")
assert.Equal(t, fee.Symbol, "ltcbtc", "Symbol should be correct")
Expand All @@ -171,10 +174,21 @@ func TestGetAccountTradingFee(t *testing.T) {
func TestGetAccountTradingFees(t *testing.T) {
t.Parallel()

if !mockTests {
sharedtestvalues.SkipTestIfCredentialsUnset(t, b)
}

fees, err := b.GetAccountTradingFees(context.Background())
assert.NoError(t, err, "GetAccountTradingFee should not error")
spew.Dump(fees)
//assert.IsType(t, , "TradingFees should be an array")
if assert.NoError(t, err, "GetAccountTradingFee should not error") {
if assert.Positive(t, len(fees), "Should get back multiple fees") {
fee := fees[0]
assert.NotEmpty(t, fee.Symbol, "Should get back a symbol")
if !mockTests {
assert.Positive(t, fee.Fees.Maker, "Maker should be positive")
assert.Positive(t, fee.Fees.Taker, "Taker should be positive")
}
}
}
}

func TestGetTicker(t *testing.T) {
Expand Down

0 comments on commit e208134

Please sign in to comment.