e2e.TestBalanceService_Get   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 19
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 12
nop 1
dl 0
loc 19
rs 9.8
c 0
b 0
f 0
1
package e2e
2
3
import (
4
	"context"
5
	"net/http"
6
	"os"
7
	"testing"
8
9
	"github.com/NdoleStudio/neero-go"
10
	"github.com/davecgh/go-spew/spew"
11
	"github.com/stretchr/testify/assert"
12
)
13
14
func TestBalanceService_Get(t *testing.T) {
15
	// Arrange
16
	request := &neero.CreatePaymentMethodRequestNeroMerchantDetails{
17
		MerchantKey: os.Getenv("NEERO_MERCHANT_KEY"),
18
		StoreID:     os.Getenv("NEERO_STORE_ID"),
19
		BalanceID:   os.Getenv("NEERO_BALANCE_ID"),
20
		OperatorID:  os.Getenv("NEERO_OPERATOR_ID"),
21
	}
22
23
	paymentMethod, _, _ := client.PaymentMethod.Create(context.Background(), request)
24
	spew.Dump(paymentMethod.ID)
25
26
	// Act
27
	balance, response, err := client.Balance.Get(context.Background(), paymentMethod.ID)
28
29
	// Assert
30
	assert.Nil(t, err)
31
	assert.Equal(t, http.StatusOK, response.HTTPResponse.StatusCode)
32
	spew.Dump(balance)
33
}
34