Repository navigation
RG-T41 Bug fixes #525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RG-T41 Bug fixes #525
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -133,6 +133,24 @@ public async Task Inventory_groups_sources_by_address_and_proximity_and_suggests | |
| _h.Crosswalks.Rows.Should().HaveCount(3); | ||
| } | ||
|
|
||
| [Test] | ||
| public async Task A_failed_poi_lookup_fails_the_inventory_instead_of_recording_it_without_pois() | ||
| { | ||
| SeedContactsWorld(); | ||
| // PoiTypesRepository logs and returns null when its query fails; a department with no POI types gets an empty list. | ||
| _h.PoiTypes.Setup(p => p.GetPoiTypesByDepartmentIdAsync(Dept)).ReturnsAsync((IEnumerable<PoiType>)null); | ||
|
|
||
| Func<Task> inventory = () => _h.OccupancyService.InventoryCandidatesAsync(Dept, Admin); | ||
| await inventory.Should().ThrowAsync<InvalidOperationException>(); | ||
| _h.Crosswalks.Rows.Should().BeEmpty(); | ||
| var status = await _h.OccupancyService.GetReconciliationStatusAsync(Dept); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unhandled task rejection from Kody rule violation: Handle async operations with proper error handling ReconciliationStatus status;
try
{
status = await _h.OccupancyService.GetReconciliationStatusAsync(Dept);
}
catch (Exception ex)
{
Assert.Fail($"Failed to retrieve reconciliation status: {ex.Message}");
return;
}Prompt for LLMTalk to Kody by mentioning @kody Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction. |
||
| status.InventoriedOn.Should().BeNull("an inventory that never saw the POIs is not recorded as run"); | ||
| status.State.Should().Be(RmsOccupancyOwnershipState.ContactsOwned); | ||
|
|
||
| _h.PoiTypes.Setup(p => p.GetPoiTypesByDepartmentIdAsync(Dept)).ReturnsAsync(new List<PoiType>()); | ||
| (await _h.OccupancyService.InventoryCandidatesAsync(Dept, Admin)).SourcesScanned.Should().Be(2, "no POI types is a successful, empty lookup"); | ||
| } | ||
|
|
||
| [Test] | ||
| public async Task Linking_a_preplan_candidate_creates_an_occupancy_with_provenance_hazards_and_a_site_link_then_the_switch_becomes_possible() | ||
| { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
External repository failure in
_poiTypes.GetPoiTypesByDepartmentIdAsync(departmentId)can leave theIReadOnlyList<PoiType> poiTypesassignment without department context or return null. CatchException, map null toInvalidOperationException, log the failure with_logger.LogErroranddepartmentId, and rethrow the original exception.Kody rule violation: Add try-catch blocks for external calls
Prompt for LLM
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.