| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 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 |