Skip to content

Commit

Permalink
test: ✅ Test refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
saniales committed Jan 4, 2024
1 parent 2226603 commit 6f444c8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ func testClient() (*coinpayments.Client, error) {
}

return coinpayments.NewClient(&coinpayments.Config{PublicKey: pubKey, PrivateKey: privateKey}, &http.Client{})

}

func TestNewClient(t *testing.T) {
if _, err := coinpayments.NewClient(&coinpayments.Config{PublicKey: "", PrivateKey: ""}, &http.Client{}); err == nil {
t.Fatalf("Should have thrown an error with emptu public and private key, but it didn't")
Expand All @@ -44,10 +44,9 @@ func TestCall(t *testing.T) {
t.Fatalf("Should have instantiated a new client with valid config and http client, but it threw error: %s", err.Error())
}

failCommand := "doesntexist"
failCommand := "invalid-command"
var txResponse coinpayments.TransactionResponse
if err := client.Call(failCommand, url.Values{}, &txResponse); err == nil {
t.Fatalf("Should have failed with non-supported command of %s", failCommand)
}

}
3 changes: 0 additions & 3 deletions info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ func TestCallGetBasicInfo(t *testing.T) {
if err != nil {
t.Fatalf("Could not call get basic info: %s", err.Error())
}

}

func TestCallRates(t *testing.T) {
Expand All @@ -26,9 +25,7 @@ func TestCallRates(t *testing.T) {
}

_, err = client.CallRates(&coinpayments.RatesRequest{Short: "1", Accepted: "0"})

if err != nil {
t.Fatalf("Could not call get basic info: %s", err.Error())
}

}
2 changes: 2 additions & 0 deletions ipn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import (
)

func TestHandleIPNDeposit(t *testing.T) {
// TODO: implement
}

func TestHandleIPNAPI(t *testing.T) {
// TODO: implement
}

0 comments on commit 6f444c8

Please sign in to comment.