Skip to content

Commit

Permalink
Fixing issue #214 as the API now doesn't return 404 when resources ex…
Browse files Browse the repository at this point in the history
…ist.
  • Loading branch information
kevbite committed Nov 28, 2024
1 parent 30d02bc commit 468cba7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ public CompaniesHousePersonsWithSignificantControlClient(HttpClient httpClient,

return new CompaniesHouseClientResponse<PersonsWithSignificantControl>(result);
}

}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Threading.Tasks;
using CompaniesHouse.Response;
using CompaniesHouse.Response.CompanyFiling;
using NUnit.Framework;

Expand All @@ -18,9 +19,13 @@ await WhenRetrievingAnCompanyFilingHistoryForAnInvalidCompany()
}

[Test]
public void ThenTheDataItemsAreNull()
public void ThenTheDataHasSomeEmptyPropertiesAndStatusOfInvalidFormat()
{
Assert.That(_result.Data.Items, Is.Null);
Assert.That(_result.Data.Items, Is.Empty);
Assert.That(_result.Data.HistoryStatus, Is.EqualTo(FilingHistoryStatus.InvalidFormat));
Assert.That(_result.Data.StartIndex, Is.EqualTo(0));
Assert.That(_result.Data.TotalCount, Is.EqualTo(0));

}

private async Task WhenRetrievingAnCompanyFilingHistoryForAnInvalidCompany()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ protected override async Task When()


[Test]
public void ThenTheDataItemsAreNull()
public void ThenTheDataIsFullWithEmptyProperties()
{
Assert.That(_result.Data, Is.Null);
Assert.That(_result.Data.Items, Is.Empty);
Assert.That(_result.Data.ActiveCount, Is.EqualTo(0));
Assert.That(_result.Data.CeasedCount, Is.EqualTo(0));
}

private async Task WhenRetrievingAnCompanyPersonsWithSignificantControlForAnInvalidCompany()
Expand Down

0 comments on commit 468cba7

Please sign in to comment.