Skip to content

Commit

Permalink
simple tests for CoinsAsList endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
solipsis committed Jan 17, 2018
1 parent 98991ea commit 5719d7a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion shapeshift.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func CoinsAsList() ([]Coin, error) {
return nil, err
}

// User json.RawMessage to delay marshalling to support arbitrary top level keys
// Use json.RawMessage to delay marshalling to support arbitrary top level keys
var coinmap map[string]*json.RawMessage
if err := json.Unmarshal(r, &coinmap); err != nil {
return coins, err
Expand Down
12 changes: 12 additions & 0 deletions shapeshift_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,18 @@ func TestDepositStatus(t *testing.T) {

}

func TestGetCoinsAsList(t *testing.T) {

coins, err := CoinsAsList()
if err != nil || len(coins) == 0 {
t.Fail()
}

t.Log("Coin: ", coins[0].Name)
t.Log("Status: ", coins[0].Status)

}

func TestGetSupportedCoins(t *testing.T) {

coins, err := Coins()
Expand Down

0 comments on commit 5719d7a

Please sign in to comment.