From 6f444c8882cd1eda6a541f2e3dd862b4beaff259 Mon Sep 17 00:00:00 2001 From: Alessandro Sanino <3513298+saniales@users.noreply.github.com> Date: Thu, 4 Jan 2024 15:51:10 +0000 Subject: [PATCH] test: :white_check_mark: Test refactor --- client_test.go | 5 ++--- info_test.go | 3 --- ipn_test.go | 2 ++ 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/client_test.go b/client_test.go index 49d5014..c7213f7 100644 --- a/client_test.go +++ b/client_test.go @@ -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") @@ -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) } - } diff --git a/info_test.go b/info_test.go index 98b81ab..0d3ac02 100644 --- a/info_test.go +++ b/info_test.go @@ -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) { @@ -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()) } - } diff --git a/ipn_test.go b/ipn_test.go index 6342584..d6745c2 100644 --- a/ipn_test.go +++ b/ipn_test.go @@ -5,7 +5,9 @@ import ( ) func TestHandleIPNDeposit(t *testing.T) { + // TODO: implement } func TestHandleIPNAPI(t *testing.T) { + // TODO: implement }