| Conditions | 1 |
| Total Lines | 20 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | package flutterwave |
||
| 12 | func TestTransactionsService_Refund(t *testing.T) { |
||
| 13 | // Setup |
||
| 14 | t.Parallel() |
||
| 15 | |||
| 16 | // Arrange |
||
| 17 | server := helpers.MakeTestServer(http.StatusOK, string(stubs.TransactionRefundResponse())) |
||
| 18 | client := New(WithBaseURL(server.URL)) |
||
| 19 | |||
| 20 | // Act |
||
| 21 | refund, response, err := client.Transactions.Refund(context.Background(), 123, 200) |
||
| 22 | |||
| 23 | // Assert |
||
| 24 | assert.Nil(t, err) |
||
| 25 | |||
| 26 | assert.Equal(t, http.StatusOK, response.HTTPResponse.StatusCode) |
||
| 27 | assert.Equal(t, stubs.TransactionRefundResponse(), *response.Body) |
||
| 28 | assert.Equal(t, 75923, refund.Data.ID) |
||
| 29 | |||
| 30 | // Teardown |
||
| 31 | server.Close() |
||
| 32 | } |
||
| 53 |