Skip to content

Commit 95bc2f6

Browse files
authored
Merge pull request #207 from kevbite/#206
#206 Add TotalResults to Officers response
2 parents 48ad528 + aa15647 commit 95bc2f6

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

src/CompaniesHouse/Response/Officers/Officers.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using CompaniesHouse.Response.CompanyProfile;
2-
using Newtonsoft.Json;
1+
using Newtonsoft.Json;
32

43
namespace CompaniesHouse.Response.Officers
54
{
@@ -13,5 +12,11 @@ public class Officers
1312

1413
[JsonProperty(PropertyName = "resigned_count")]
1514
public int? ResignedCount { get; set; }
15+
16+
[JsonProperty(PropertyName = "total_results")]
17+
public int TotalResults { get; set; }
18+
19+
[JsonProperty(PropertyName = "start_index")]
20+
public int StartIndex { get; set; }
1621
}
1722
}

tests/CompaniesHouse.Tests/CompaniesHouseOfficersTests/OfficersBuilder.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public Officers Build()
2828
.With(x => x.Items, officerSummary.Items)
2929
.With(x => x.ActiveCount, officerSummary.ActiveCount)
3030
.With(x => x.ResignedCount, officerSummary.ResignedCount)
31+
.With(x => x.TotalResults, officerSummary.Items.Length)
32+
.With(x => x.StartIndex, 1)
3133
.Create();
3234

3335
return result;

tests/CompaniesHouse.Tests/ResourceBuilders/Officers.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,9 @@ public class Officers
77
public Officer[] Items { get; set; }
88

99
public int ResignedCount { get; set; }
10+
11+
public int TotalResults { get; set; }
12+
13+
public int StartIndex { get; set; }
1014
}
1115
}

tests/CompaniesHouse.Tests/ResourceBuilders/OfficersResourceBuilder.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ public string Create()
2020
""items"" : [
2121
{string.Join(",", _officers.Items.Select(CreateSingle).ToArray())}
2222
],
23-
""resigned_count"" : {_officers.ResignedCount}
23+
""resigned_count"" : {_officers.ResignedCount},
24+
""total_results"" : {_officers.TotalResults},
25+
""start_index"" : {_officers.StartIndex},
2426
}}";
2527
}
2628

0 commit comments

Comments
 (0)