Skip to content

Commit

Permalink
Change invoice test amount to float64
Browse files Browse the repository at this point in the history
  • Loading branch information
sekaranglila committed Nov 30, 2023
1 parent a90d914 commit 1c70995
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/api_invoice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func Test_xendit_InvoiceApiService(t *testing.T) {
apiClient := xendit.NewClient(apiKey)

t.Run("Test InvoiceApiService CreateInvoice", func(t *testing.T) {
createInvoiceRequest := *invoice.NewCreateInvoiceRequest(time.Now().Format("20060102150405"), float32(10000))
createInvoiceRequest := *invoice.NewCreateInvoiceRequest(time.Now().Format("20060102150405"), float64(10000))
resp, httpRes, err := apiClient.InvoiceApi.
CreateInvoice(context.Background()).
CreateInvoiceRequest(createInvoiceRequest).
Expand All @@ -40,7 +40,8 @@ func Test_xendit_InvoiceApiService(t *testing.T) {
if err != nil {
fmt.Fprintf(os.Stdout, "CreateInvoice Err`: %v\n", err)
} else {
fmt.Fprintf(os.Stdout, "CreateInvoice Res`: %v\n", resp)
r, _ := resp.MarshalJSON()
fmt.Fprintf(os.Stdout, "CreateInvoice Res`: %v\n", string(r))

require.NotNil(t, resp)
assert.Equal(t, 200, httpRes.StatusCode)
Expand All @@ -57,7 +58,8 @@ func Test_xendit_InvoiceApiService(t *testing.T) {
if err != nil {
fmt.Fprintf(os.Stdout, "GetInvoiceById Err`: %v\n", err)
} else {
fmt.Fprintf(os.Stdout, "GetInvoiceById Res`: %v\n", resp)
r, _ := resp.MarshalJSON()
fmt.Fprintf(os.Stdout, "GetInvoiceById Res`: %v\n", string(r))

require.NotNil(t, resp)
assert.Equal(t, 200, httpRes.StatusCode)
Expand Down

0 comments on commit 1c70995

Please sign in to comment.