=== Summary: 675 files | 7 generated | 484 fresh | 4605 untracked | 4268 adopted | 355 marked | 466 validated-ok | 2+0 stale (sig+body) | 0 skipped | 0 failed | elapsed 11:08:11.442 (40091.44s) ===

This commit is contained in:
julian
2026-06-28 02:50:05 -07:00
parent a19fb90902
commit 586f02a2ca
654 changed files with 5260 additions and 0 deletions
@@ -18,6 +18,7 @@ namespace adas_core.Test.Services;
/// <summary>
/// Contains unit tests for verifying the behavior of the <see cref="AdmissionService"/> class.
/// </summary>
/// <!-- aidoc:v1 sig=0c8cbc0 -->
public class AdmissionServiceTest
{
private Mock<IAdmissionRepository> _admissionRepositoryMock;
@@ -89,6 +90,7 @@ public class AdmissionServiceTest
/// Verifies that the admission service successfully deletes a valid admission by ensuring the repository's
/// Delete operation is invoked exactly once for the corresponding admission identifier.
/// </summary>
/// <!-- aidoc:v1 sig=ff6349a body=41733f5 -->
[Test]
public async Task DeleteAdmissionAsync_ValidAdmission_DeletesSuccessfully()
{
@@ -109,6 +111,7 @@ public class AdmissionServiceTest
/// <summary>
/// Verifies that <c>DeleteAdmissionByIdAsync</c> successfully deletes an admission when it exists in the repository, by ensuring the repository's <c>Delete</c> method is invoked exactly once for the given admission identifier.
/// </summary>
/// <!-- aidoc:v1 sig=ca0aebd body=1a986c5 -->
[Test]
public async Task DeleteAdmissionByIdAsync_AdmissionExists_DeletesSuccessfully()
{
@@ -131,6 +134,7 @@ public class AdmissionServiceTest
/// associated patient location (unit, bed, and room) when the admission exists in the repository and the
/// corresponding point of care is successfully resolved.
/// </summary>
/// <!-- aidoc:v1 sig=8868841 body=7a047e6 -->
[Test]
public async Task GetAdmissionByIdAsync_AdmissionExists_ReturnsAdmissionWithPatientLocation()
{
@@ -160,6 +164,7 @@ public class AdmissionServiceTest
/// Verifies that GetAdmissionsAsync returns admissions enriched with their associated patient location details
/// retrieved from the point of care service.
/// </summary>
/// <!-- aidoc:v1 sig=13eea4d body=5097039 -->
[Test]
public async Task GetAdmissionsAsync_ReturnsAdmissionsWithPatientLocations()
{
@@ -233,6 +238,7 @@ public class AdmissionServiceTest
/// invoking the repository's Update method and retrieving point-of-care information for both the new and the
/// previous point of care associated with the admission.
/// </summary>
/// <!-- aidoc:v1 sig=947fcb9 body=5539a54 -->
[Test]
public async Task UpdateAdmissionAsync_WhenAdmissionExists_UpdatesAdmission()
{
@@ -287,6 +293,7 @@ public class AdmissionServiceTest
/// <summary>
/// Verifies that admitting a patient with a valid admission—where the associated unit is found and the point of care matches—results in a new patient being inserted.
/// </summary>
/// <!-- aidoc:v1 sig=e2d99bb body=d8e5f1d -->
[Test]
public async Task AdmitPatient_WithValidAdmission_CreatesPatientAndDeletesAdmission()
{
@@ -315,6 +322,7 @@ public class AdmissionServiceTest
/// <summary>
/// Verifies that GetAdmissionByLocation returns the expected list of admissions when a matching patient location is found, confirming the service correctly retrieves results from the repository.
/// </summary>
/// <!-- aidoc:v1 sig=1bd035d body=629b781 -->
[Test]
public async Task GetAdmissionByLocation_LocationExists_ReturnsAdmissions()
{
@@ -345,6 +353,7 @@ public class AdmissionServiceTest
/// <summary>
/// Verifies that <see cref="AdmissionService.GetAdmissionByLocation"/> returns an empty result when the requested location does not exist, simulating the not-found scenario by having the repository throw an exception.
/// </summary>
/// <!-- aidoc:v1 sig=3fa7d19 body=0413056 -->
[Test]
public async Task GetAdmissionByLocation_LocationNotFound_ReturnsNull()
{
@@ -371,6 +380,7 @@ public class AdmissionServiceTest
/// <c>GetAdmissionByPointOfCareId</c> are enriched with patient location details (unit name, bed, and room)
/// retrieved from the corresponding Point of Care entity.
/// </summary>
/// <!-- aidoc:v1 sig=9e8788f body=f355f5f -->
[Test]
public async Task GetAdmissionByPointOfCareId_POCExists_ReturnsAdmissionsWithLocation()
{
@@ -414,6 +424,7 @@ public class AdmissionServiceTest
/// <summary>
/// Verifies that <see cref="AdmissionService.GetAdmissionByPointOfCareId"/> returns an empty result when the underlying repository throws an exception while attempting to find an admission by point of care id.
/// </summary>
/// <!-- aidoc:v1 sig=38a42b6 body=272b246 -->
[Test]
public async Task GetAdmissionByPointOfCareId_POCNotFound_ReturnsNull()
{
@@ -434,6 +445,7 @@ public class AdmissionServiceTest
/// Verifies that <see cref="AdmissionService.GetAdmissionByUnitIdWithOutPoC"/> returns the expected list of admissions
/// when a valid unit identifier is provided.
/// </summary>
/// <!-- aidoc:v1 sig=991c53f body=6e3b77c -->
[Test]
public async Task GetAdmissionByUnitIdWithOutPoC_UnitIdExists_ReturnsAdmissions()
{
@@ -462,6 +474,8 @@ public class AdmissionServiceTest
/// throws an exception while looking up the given unit identifier.
/// </summary>
/// <param name="unitId">The identifier of the unit whose admission record is being requested.</param>
/// <!-- aidoc-review:v1 severity=medium kind=extra_param
/// "The <param name=\"unitId\"> tag documents a parameter that does not exist on the test method; unitId is a local variable, not a method parameter." -->
[Test]
public async Task GetAdmissionByUnitIdWithOutPoC_UnitIdNotFound_ReturnsNull()
{
@@ -580,6 +594,7 @@ public class AdmissionServiceTest
/// <summary>
/// Verifies that InsertAdmission throws a NotFoundException and performs no insert or update operations when a required associated resource is not found while processing a valid admission.
/// </summary>
/// <!-- aidoc:v1 sig=bdfda99 body=4d28639 -->
[Test]
public async Task InsertAdmission_ValidAdmission_InsertsSuccessfullyWithUser()
{