Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vadim Petrov
committed
Jul 14, 2017
1 parent
1718a0d
commit 7512c94
Showing
19 changed files
with
241 additions
and
76 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package zooz | ||
|
||
import "testing" | ||
|
||
func TestAuthorizationClient_authorizationPath(t *testing.T) { | ||
c := &AuthorizationClient{} | ||
p := c.authorizationPath("payment_id", "authorization_id") | ||
if p != "payments/payment_id/authorizations/authorization_id" { | ||
t.Errorf("Invalid authorization path: %s", p) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package zooz | ||
|
||
import "testing" | ||
|
||
func TestCaptureClient_capturePath(t *testing.T) { | ||
c := &CaptureClient{} | ||
p := c.capturePath("payment_id", "capture_id") | ||
if p != "payments/payment_id/captures/capture_id" { | ||
t.Errorf("Invalid capture path: %s", p) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package zooz | ||
|
||
import "testing" | ||
|
||
func TestChargeClient_chargePath(t *testing.T) { | ||
c := &ChargeClient{} | ||
p := c.chargePath("payment_id", "charge_id") | ||
if p != "payments/payment_id/charges/charge_id" { | ||
t.Errorf("Invalid charge path: %s", p) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package zooz | ||
|
||
import "testing" | ||
|
||
func TestCustomerClient_customerPath(t *testing.T) { | ||
c := &CustomerClient{} | ||
p := c.customerPath("customer_id") | ||
if p != "customers/customer_id" { | ||
t.Errorf("Invalid customer path: %s", p) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package zooz | ||
|
||
import "testing" | ||
|
||
func TestError(t *testing.T) { | ||
e := &Error{ | ||
StatusCode: 500, | ||
RequestID: "request_id", | ||
APIError: APIError{ | ||
Category: "cat", | ||
Description: "desc", | ||
MoreInfo: "info", | ||
}, | ||
} | ||
|
||
var err error = e | ||
|
||
if err.Error() != `request: request_id, status: 500, error: {"category":"cat","description":"desc","more_info":"info"}` { | ||
t.Errorf("Invalid error: %s", err.Error()) | ||
} | ||
} |
Oops, something went wrong.