=== 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
@@ -83,6 +83,7 @@ public class ConfigObservationServiceTest
/// Configures a default authenticated <see cref="ClaimsPrincipal"/> in the HTTP context and sets the cache mocks to bypass caching by executing the factory function directly,
/// ensuring repository calls are invoked during tests.
/// </summary>
/// <!-- aidoc:v1 sig=dee8bf2 body=baa71ba -->
[SetUp]
public void Setup()
{
@@ -144,6 +145,8 @@ public class ConfigObservationServiceTest
/// <summary>
/// Verifies that querying a patient observation by <c>CodingSystem</c> only, without specifying a code or name, returns a null result.
/// </summary>
/// <!-- aidoc-review:v1 severity=high kind=wrong_summary
/// "The summary states the query is performed 'without specifying a code or name', but the test code explicitly sets Code = \"Pump_X\" and Name = \"Alarm_Pump_X\" on the PatientObservation before calling _service.Get(obs)." -->
[Test]
public async Task Get_config_observation_item_by_codingSystem_only_return_null()
{
@@ -163,6 +166,7 @@ public class ConfigObservationServiceTest
/// Verifies that <c>Get</c> returns the matching patient observation configuration for a given observation identified by its code and coding system.
/// Asserts that the resolved item is not null and that the displayed name is mapped from the configured lookup to the expected localized value.
/// </summary>
/// <!-- aidoc:v1 sig=d32a79d body=97b6327 -->
[Test]
public async Task Get_config_observation_item_by_code_and_codingSystem()
{
@@ -186,6 +190,7 @@ public class ConfigObservationServiceTest
/// matching the requested observation against the list returned by the repository and returning
/// the item with the expected name.
/// </summary>
/// <!-- aidoc:v1 sig=3d7c0ca body=615f166 -->
[Test]
public async Task Get_config_observation_item_by_name()
{
@@ -201,6 +206,7 @@ public class ConfigObservationServiceTest
/// <summary>
/// Verifies that the service returns null when a patient observation item is requested by a name that does not exist in the configuration list.
/// </summary>
/// <!-- aidoc:v1 sig=fa14228 body=beae3aa -->
[Test]
public async Task Get_config_observation_item_by_name_not_exist_returns_null()
{
@@ -216,6 +222,7 @@ public class ConfigObservationServiceTest
/// <summary>
/// Verifies that the service retrieves the correct configuration by matching both the observation code with its coding system and the parent data code with its coding system, returning the configuration named "ph".
/// </summary>
/// <!-- aidoc:v1 sig=2711221 body=baf8942 -->
[Test]
public async Task Get_config_by_code_and_parent()
{
@@ -241,6 +248,7 @@ public class ConfigObservationServiceTest
/// Verifies that the mapping service returns <c>null</c> when the observation name is unknown
/// and the configuration is set to ignore unknown observations.
/// </summary>
/// <!-- aidoc:v1 sig=b604759 body=1c3599d -->
[Test]
public async Task Map_unknown_ignore_true_returns_null()
{
@@ -257,6 +265,7 @@ public class ConfigObservationServiceTest
/// the <c>Map</c> method returns the original observation as-is when no matching record is found
/// in the repository, rather than discarding it as an unknown observation.
/// </summary>
/// <!-- aidoc:v1 sig=bb05709 body=c204c4b -->
[Test]
public async Task Map_unknown_ignore_false_returns_obs()
{
@@ -273,6 +282,7 @@ public class ConfigObservationServiceTest
/// <summary>
/// Verifies that mapping a patient observation with a value of 14 results in an "Ok" status, confirming the threshold mapping logic returns the expected outcome.
/// </summary>
/// <!-- aidoc:v1 sig=81e9217 body=d5f8b5a -->
[Test]
public async Task Map_threshold_Ok()
{
@@ -293,6 +303,7 @@ public class ConfigObservationServiceTest
/// <summary>
/// Tests that the Map method returns a Warning status when a patient observation value exceeds the configured threshold.
/// </summary>
/// <!-- aidoc:v1 sig=62b87c5 body=8312d29 -->
[Test]
public async Task Map_threshold_Warning()
{
@@ -313,6 +324,7 @@ public class ConfigObservationServiceTest
/// <summary>
/// Verifies that mapping a <see cref="PatientObservation"/> with a SOFA score of 9 through the configured service results in a result with an <see cref="StatusEnum.Type.Alert"/> status.
/// </summary>
/// <!-- aidoc:v1 sig=b9d47f9 body=ff5f81e -->
[Test]
public async Task Map_threshold_Alert()
{
@@ -334,6 +346,7 @@ public class ConfigObservationServiceTest
/// Verifies that mapping a parent <see cref="PatientObservation"/> returns an <see cref="StatusEnum.Type.Ok"/> status
/// when the repository successfully locates the configuration by identifier.
/// </summary>
/// <!-- aidoc:v1 sig=ba42824 body=c7bbf55 -->
[Test]
public async Task Map_parent_ok()
{
@@ -354,6 +367,7 @@ public class ConfigObservationServiceTest
/// <summary>
/// Verifies that <c>UpdateConfig</c> successfully updates an existing configuration and returns the updated <see cref="ConfigObservation"/> with the new name.
/// </summary>
/// <!-- aidoc:v1 sig=18d4b11 body=f7f80a4 -->
[Test]
public async Task UpdateConfig_ok()
{
@@ -376,6 +390,7 @@ public class ConfigObservationServiceTest
/// <summary>
/// Verifies that <c>UpdateConfig</c> throws a <see cref="NotFoundException"/> when the target <c>ConfigObservation</c> cannot be found by its identifier.
/// </summary>
/// <!-- aidoc:v1 sig=470341f body=33e9665 -->
[Test]
public async Task UpdateConfig_notfound()
{
@@ -392,6 +407,7 @@ public class ConfigObservationServiceTest
/// <summary>
/// Verifies that the <c>CreateConfig</c> service method successfully inserts the provided configuration and returns the expected result.
/// </summary>
/// <!-- aidoc:v1 sig=4c4fb2f body=19b37b8 -->
[Test]
public async Task CreateConfig_ok()
{
@@ -405,6 +421,7 @@ public class ConfigObservationServiceTest
/// <summary>
/// Verifies that <see cref="BadRequestException"/> is thrown when attempting to create a configuration that already exists.
/// </summary>
/// <!-- aidoc:v1 sig=ea4710c body=04477ed -->
[Test]
public void CreateConfig_duplicate_throws()
{
@@ -420,6 +437,7 @@ public class ConfigObservationServiceTest
/// <summary>
/// Verifies that RemoveConfigItem successfully removes a configuration item and returns the deleted entity when the repository finds and deletes it.
/// </summary>
/// <!-- aidoc:v1 sig=30c283f body=7951323 -->
[Test]
public async Task RemoveConfigItem_ok()
{
@@ -436,6 +454,7 @@ public class ConfigObservationServiceTest
/// <summary>
/// Verifies that <c>RemoveConfigItem</c> returns <c>null</c> when the underlying delete operation on the repository yields no result, simulating the case where the configuration item does not exist.
/// </summary>
/// <!-- aidoc:v1 sig=87b0794 body=76439aa -->
[Test]
public async Task RemoveConfigItem_null()
{