refactor: inline mockResultInfo because 50 is specific to ListZones.
@@ -124,16 +124,6 @@ func mockZone(i int) *Zone {
}
}
-func mockResultInfo(total, page, start, count int) *ResultInfo {
- return &ResultInfo{
- Page: page,
- PerPage: 50,
- TotalPages: (total + 49) / 50,
- Count: count,
- Total: total,
- }
-}
-
func mockZonesResponse(total, page, start, count int) *ZonesResponse {
zones := make([]Zone, count)
for i := range zones {
@@ -142,7 +132,13 @@ func mockZonesResponse(total, page, start, count int) *ZonesResponse {
return &ZonesResponse{
Result: zones,
- ResultInfo: *mockResultInfo(total, page, start, count),
+ ResultInfo: ResultInfo{
+ Page: page,
+ PerPage: listZonesPerPage,
+ TotalPages: (total + listZonesPerPage - 1) / listZonesPerPage,
+ Count: count,
+ Total: total,
+ },
Response: Response{
Success: true,
Errors: []ResponseInfo{},
