Skip to content

Commit

Permalink
Merge pull request #136 from xendit/feat/mintx-376/change-invoice-tes…
Browse files Browse the repository at this point in the history
…t-amount-to-float64

Change invoice test amount to float64
  • Loading branch information
sekaranglila authored Dec 1, 2023
2 parents a90d914 + 1c70995 commit 3376e3f
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 3376e3f

Please sign in to comment.