=== 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:
@@ -16,6 +16,7 @@ namespace adas_core.Test.Services;
|
||||
/// <summary>
|
||||
/// Provides unit tests for the <see cref="DischargeService"/> class, verifying the behavior and correctness of discharge-related operations.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=400fd1a -->
|
||||
public class DischargeServiceTest
|
||||
{
|
||||
private readonly Mock<ILocalAuditService> _auditServiceMock = new();
|
||||
@@ -34,6 +35,7 @@ public class DischargeServiceTest
|
||||
/// <summary>
|
||||
/// Sets up the test environment by creating a mock authenticated user context and instantiating the <see cref="DischargeService"/> with its required dependencies for use in unit tests.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=dee8bf2 body=c3b979f -->
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
@@ -66,6 +68,8 @@ public class DischargeServiceTest
|
||||
/// when it exists in the repository.
|
||||
/// </summary>
|
||||
/// <param name="discharge">The discharge entity expected to be deleted; its identifier is used to invoke the repository delete operation.</param>
|
||||
/// <!-- aidoc-review:v1 severity=medium kind=extra_param
|
||||
/// "The test method takes no parameters, but the documentation includes a <param name=\"discharge\"> tag. The discharge is an argument passed to the production method being tested, not a parameter of the test itself." -->
|
||||
[Test]
|
||||
public async Task DeleteDischargeAsync_WhenDischargeExists_DeletesDischarge()
|
||||
{
|
||||
@@ -100,6 +104,7 @@ public class DischargeServiceTest
|
||||
/// <summary>
|
||||
/// Verifies that <see cref="DischargeService.GetDischargeByIdAsync"/> throws a <see cref="NotFoundException"/> when the requested discharge is not found.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=52f2a9a body=86f9d19 -->
|
||||
[Test]
|
||||
public void GetDischargeByIdAsync_WhenExceptionOccurs_ReturnsNullAndLogsError()
|
||||
{
|
||||
@@ -114,6 +119,7 @@ public class DischargeServiceTest
|
||||
/// Verifies that the discharge service returns the expected discharges retrieved from the repository when the underlying repository call completes successfully without exceptions.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="Task"/> representing the asynchronous test execution.</returns>
|
||||
/// <!-- aidoc:v1 sig=11f6fa6 body=746f877 -->
|
||||
[Test]
|
||||
public async Task GetDischargesAsync_WhenNoException_ReturnsDischarges()
|
||||
{
|
||||
@@ -150,6 +156,7 @@ public class DischargeServiceTest
|
||||
/// Verifies that <see cref="DischargeService.InsertDischarge"/> returns the inserted discharge
|
||||
/// when the underlying repository successfully completes the insertion and the entity can be retrieved by its identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=f69e0b9 body=aed5a93 -->
|
||||
[Test]
|
||||
public async Task InsertDischarge_WhenInsertionSuccessful_ReturnsInsertedDischarge()
|
||||
{
|
||||
@@ -169,6 +176,7 @@ public class DischargeServiceTest
|
||||
/// <summary>
|
||||
/// Verifies that <see cref="DischargeService.InsertDischarge"/> handles repository insertion failures by propagating the exception thrown by the underlying data store.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=b44150e body=8660eb8 -->
|
||||
[Test]
|
||||
public void InsertDischarge_WhenInsertionFails_ReturnsNullAndLogsError()
|
||||
{
|
||||
@@ -186,6 +194,7 @@ public class DischargeServiceTest
|
||||
/// Verifies that <see cref="DischargeService.GetDischargeByLocation"/> returns the discharge
|
||||
/// retrieved from the repository when a discharge exists for the specified patient location.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=a7b4f8b body=70251df -->
|
||||
[Test]
|
||||
public async Task GetDischargeByLocation_WhenDischargeExists_ReturnsDischarge()
|
||||
{
|
||||
@@ -204,6 +213,7 @@ public class DischargeServiceTest
|
||||
/// <summary>
|
||||
/// Verifies that <see cref="IDischargeService.GetDischargeByLocation"/> returns <c>null</c> when the underlying discharge repository throws an exception while retrieving the discharge record for the specified patient location.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=2531264 body=4379b10 -->
|
||||
[Test]
|
||||
public async Task GetDischargeByLocation_WhenExceptionOccurs_ReturnsNullAndLogsError()
|
||||
{
|
||||
@@ -236,6 +246,7 @@ public class DischargeServiceTest
|
||||
/// <summary>
|
||||
/// Verifies that <see cref="DischargeService.GetDischargeByPointOfCareId"/> returns <c>null</c> when the underlying repository throws an exception while attempting to retrieve a discharge by its point-of-care identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=3c82b56 body=9141fcb -->
|
||||
[Test]
|
||||
public async Task GetDischargeByPointOfCareId_WhenExceptionOccurs_ReturnsNullAndLogsError()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user