| Conditions | 1 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | package afrikpay |
||
| 13 | func TestOptionService_GetOptions(t *testing.T) { |
||
| 14 | // Arrange |
||
| 15 | apiKey := "test-api-key" |
||
| 16 | server := helpers.MakeTestServer(http.StatusOK, stubs.CanalPlusOptionResponse()) |
||
| 17 | client := New(WithBaseURL(server.URL), WithAPIKey(apiKey)) |
||
| 18 | |||
| 19 | // Act |
||
| 20 | options, response, err := client.CanalPlus.GetOptions(context.Background(), &CanalPlusOptionRequest{ |
||
| 21 | ReferenceNumber: "11111111111111", |
||
| 22 | }) |
||
| 23 | |||
| 24 | // Assert |
||
| 25 | assert.Nil(t, err) |
||
| 26 | assert.Equal(t, http.StatusOK, response.HTTPResponse.StatusCode) |
||
| 27 | assert.Equal(t, 6, len(options.Result)) |
||
| 28 | } |
||
| 29 |