=== 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:
@@ -25,6 +25,7 @@ public class AdmissionRepositoryTest
|
||||
/// Initializes the integration test environment by resetting the admissions collection
|
||||
/// and seeding it with valid admission records to be used across the test fixture.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=3f12caf -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -57,6 +58,7 @@ public class AdmissionRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <see cref="AdmissionRepository.InsertOneAsync"/> successfully persists a valid admission so that it can subsequently be retrieved by its identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=6ca2d2e body=b9057c2 -->
|
||||
[Test]
|
||||
public async Task InsertOneAsync_Success()
|
||||
{
|
||||
@@ -76,6 +78,7 @@ public class AdmissionRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository successfully deletes an admission record, ensuring that the deleted admission can no longer be retrieved by its identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=0c937b9 body=c7bb396 -->
|
||||
[Test]
|
||||
public async Task Delete_Success()
|
||||
{
|
||||
@@ -94,6 +97,7 @@ public class AdmissionRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <see cref="Admission"/> updates are persisted successfully by inserting an admission, modifying one of its fields, and asserting that the updated value is retrieved.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=cadac73 body=ac0859e -->
|
||||
[Test]
|
||||
public async Task Update_Success()
|
||||
{
|
||||
@@ -118,6 +122,7 @@ public class AdmissionRepositoryTest
|
||||
/// <c>PointOfCareId</c> of an existing admission to the specified new location identifier
|
||||
/// and that the change is persisted in the repository.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=25ab00f body=a9cfae4 -->
|
||||
[Test]
|
||||
public async Task UpdateLocation_Success()
|
||||
{
|
||||
@@ -142,6 +147,7 @@ public class AdmissionRepositoryTest
|
||||
/// Verifies that the repository successfully updates the patient information of an existing admission,
|
||||
/// ensuring the updated admission can be retrieved and reflects the new patient's details.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=cc5dc00 body=d8a50b1 -->
|
||||
[Test]
|
||||
public async Task UpdatePatient_Success()
|
||||
{
|
||||
@@ -170,6 +176,7 @@ public class AdmissionRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's FindAll operation successfully retrieves all admissions, returning a non-empty collection of exactly three records.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=9b3759c body=0845192 -->
|
||||
[Test]
|
||||
public async Task FindAll_Success()
|
||||
{
|
||||
@@ -189,6 +196,7 @@ public class AdmissionRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository successfully retrieves an admission by its unique identifier after it has been inserted.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=2d082b2 body=9d58a46 -->
|
||||
[Test]
|
||||
public async Task FindById_Success()
|
||||
{
|
||||
@@ -207,6 +215,7 @@ public class AdmissionRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's <c>FindById</c> method returns <c>null</c> when queried with a non-existing identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=464d0a4 body=1ff6d58 -->
|
||||
[Test]
|
||||
public async Task FindById_NotFound()
|
||||
{
|
||||
@@ -224,6 +233,7 @@ public class AdmissionRepositoryTest
|
||||
/// Verifies that <see cref="AdmissionRepository.FindByNhc"/> successfully retrieves an admission record from the repository using its NHC identifier.
|
||||
/// Confirms that the returned record is not null and that the NHC of the retrieved admission matches the one used in the lookup.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=313e6e8 body=dd6590c -->
|
||||
[Test]
|
||||
public async Task FindByNhc_Success()
|
||||
{
|
||||
@@ -242,6 +252,7 @@ public class AdmissionRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <see cref="AdmissionRepository"/>.<c>FindByNhc</c> returns <c>null</c> when the provided NHC does not exist in the data source.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=f2a806f body=99d3860 -->
|
||||
[Test]
|
||||
public async Task FindByNhc_NotFound()
|
||||
{
|
||||
@@ -319,6 +330,7 @@ public class AdmissionRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that inserting a valid admission through the repository returns the same admission and persists it so it can be retrieved by its identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=5e423f0 body=ff7f179 -->
|
||||
[Test]
|
||||
public async Task InsertOneAsyncAndReturn_Success()
|
||||
{
|
||||
@@ -341,6 +353,7 @@ public class AdmissionRepositoryTest
|
||||
/// Tests that the repository's <c>GetAdmissionByUnitIdWithOutPoC</c> method returns only the admissions matching the specified unit identifier
|
||||
/// while excluding admissions that have an associated point-of-care identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=5759221 body=88f5048 -->
|
||||
[Test]
|
||||
public async Task GetAdmissionByUnitIdWithOutPoC_Success()
|
||||
{
|
||||
@@ -370,6 +383,7 @@ public class AdmissionRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>GetAdmissionByUnitIdWithOutPoC</c> returns an empty result set (instead of null) when no admissions match the provided unit identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=2150f4c body=a2de31a -->
|
||||
[Test]
|
||||
public async Task GetAdmissionByUnitIdWithOutPoC_NoMatch()
|
||||
{
|
||||
@@ -387,6 +401,7 @@ public class AdmissionRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's <c>FindByPointOfCareId</c> method successfully retrieves the admission matching the specified point of care identifier, returning a single result and excluding admissions associated with different point of care identifiers.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=88efc70 body=b058bc3 -->
|
||||
[Test]
|
||||
public async Task FindByPointOfCareId_Success()
|
||||
{
|
||||
@@ -410,6 +425,7 @@ public class AdmissionRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <see cref="AdmissionRepository"/>.FindByPointOfCareId returns a non-null empty collection when no point of care matches the provided identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=10c01cc body=b5fceef -->
|
||||
[Test]
|
||||
public async Task FindByPointOfCareId_NoMatch()
|
||||
{
|
||||
@@ -424,6 +440,7 @@ public class AdmissionRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <see cref="AdmissionRepository"/>.<c>FindByDiagnosis</c> successfully returns a non-null result when retrieving admissions matching the specified diagnosis value.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=070caef body=da3bf67 -->
|
||||
[Test]
|
||||
public async Task FindByDiagnosis_Success()
|
||||
{
|
||||
@@ -445,6 +462,7 @@ public class AdmissionRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <see cref="AdmissionRepository"/>.<c>FindByDiagnosis</c> returns an empty collection when no entity matches the provided diagnosis.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=2b70ce2 body=fefa57f -->
|
||||
[Test]
|
||||
public async Task FindByDiagnosis_NoMatch()
|
||||
{
|
||||
|
||||
@@ -27,6 +27,7 @@ public class AlarmRepositoryTest
|
||||
/// <see cref="PatientObservationAlarm"/> records by resetting the target
|
||||
/// collection and inserting the test data for use across the test fixture.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=0cc6054 -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -87,6 +88,8 @@ public class AlarmRepositoryTest
|
||||
/// </summary>
|
||||
/// <param name="filter">The collection of <see cref="Field"/> objects used to filter observations; contains a single non-existent field to ensure no matches are found.</param>
|
||||
/// <returns>A task that completes after asserting the repository returns a non-null but empty result.</returns>
|
||||
/// <!-- aidoc-review:v1 severity=medium kind=extra_param
|
||||
/// "The test method has no parameters, but the documentation includes a <param name=\"filter\"> describing the local variable rather than a method parameter." -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientLastObservationsByField_Not_Found_Returns_Empty_List()
|
||||
{
|
||||
@@ -109,6 +112,7 @@ public class AlarmRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that AggregatedPatientLastObservationsByField returns exactly one aggregated result when matching last observations are found for the specified patient and field filter.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=9bbf1e0 body=05c8194 -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientLastObservationsByField_Found_Returns_1()
|
||||
{
|
||||
@@ -131,6 +135,7 @@ public class AlarmRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <see cref="AlarmRepository.AggregatedPatientLastObservationsByField"/> returns a non-null collection containing an entry for each matching field in the filter when observations are found for the given patient.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=7bd117f body=144c5f6 -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientLastObservationsByField_Found_Returns_2()
|
||||
{
|
||||
@@ -159,6 +164,7 @@ public class AlarmRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository returns an empty list when querying aggregated patient last observations by field with a filter that specifies OnlyExpired as true, and the matching patient observation alarm is expired.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=80c2dcc body=92a6f2f -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientLastObservationsByField_AllExpired_Returns_Empty_List()
|
||||
{
|
||||
@@ -198,6 +204,7 @@ public class AlarmRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that when multiple observations exist for the same field, the aggregation returns only the most recent observation based on the timestamp.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=36c9e3d body=9fe0818 -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientLastObservationsByField_MultipleObservations_Returns_Most_Recent()
|
||||
{
|
||||
@@ -254,6 +261,7 @@ public class AlarmRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <see cref="AlarmRepository.AggregatedPatientLastObservationsByField"/> returns all of a patient's last observations when no field filter is provided.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=621b9bb body=6fff436 -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientLastObservationsByField_FilterObservations_Null_Returns_All()
|
||||
{
|
||||
|
||||
@@ -28,6 +28,7 @@ public class AppointmentArchiveRepositoryTest
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="Task"/> that completes when the collection has been recreated and both
|
||||
/// seed appointments have been inserted.</returns>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=d044105 -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -95,6 +96,7 @@ public class AppointmentArchiveRepositoryTest
|
||||
/// with a timestamp earlier than the specified cutoff date (two hours before the current time),
|
||||
/// while retaining records dated at or after the cutoff for the given patient.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d3a5eeb body=7124e14 -->
|
||||
[Test]
|
||||
public async Task DeleteBeforeDate()
|
||||
{
|
||||
|
||||
@@ -22,6 +22,7 @@ public class AppointmentRepositoryTest
|
||||
/// <summary>
|
||||
/// Performs one-time setup for integration tests by resetting the patients_appointments collection and seeding it with two test patient appointments: one with minimal fields and another extended with visit number, appointment reason, and resource groups.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=af4b115 -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -85,6 +86,7 @@ public class AppointmentRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <see cref="AppointmentRepository"/>.GetByPatient returns a non-null, non-empty list when a valid patient identifier is provided.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=b07f445 body=1ecc19f -->
|
||||
[Test]
|
||||
public async Task GetByPatient_Find_Patient_Return_List()
|
||||
{
|
||||
@@ -97,6 +99,7 @@ public class AppointmentRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <see cref="AppointmentRepository.GetByPatient"/> returns a non-null, empty list when no records are found for the specified patient identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=11046fe body=f92c1ae -->
|
||||
[Test]
|
||||
public async Task GetByPatient_not_Find_Patient_Return_Empty_List()
|
||||
{
|
||||
@@ -109,6 +112,7 @@ public class AppointmentRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository returns <c>null</c> when no patient is found matching the specified patient identifier and visit number.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=a3c1464 body=169eed1 -->
|
||||
[Test]
|
||||
public async Task FindByPatientAndVisitNumber_Not_Find_Patient_Return_Null()
|
||||
{
|
||||
@@ -121,6 +125,7 @@ public class AppointmentRepositoryTest
|
||||
/// Verifies that the repository's FindByPatientAndVisitNumber method successfully retrieves
|
||||
/// the corresponding appointment when a valid patient identifier and an existing visit number are supplied.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=c9fc233 body=1b1a8ee -->
|
||||
[Test]
|
||||
public async Task FindByPatientAndVisitNumber_Find_Patient_Return_Appointment()
|
||||
{
|
||||
@@ -133,6 +138,7 @@ public class AppointmentRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository returns null when searching for an appointment by patient ID and a reason that does not match any existing appointment.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=8261277 body=aaea632 -->
|
||||
[Test]
|
||||
public async Task FindByPatientAndReason_Not_Find_Patient_Return_Null()
|
||||
{
|
||||
@@ -144,6 +150,7 @@ public class AppointmentRepositoryTest
|
||||
/// <summary>
|
||||
/// Tests that FindByPatientAndReason returns a non-null appointment containing the expected AppointmentReason for the specified patient.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=97cceac body=2ab244e -->
|
||||
[Test]
|
||||
public async Task FindByPatientAndReason_Find_Patient_Return_Appointment()
|
||||
{
|
||||
@@ -156,6 +163,7 @@ public class AppointmentRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <see cref="AppointmentRepository"/>.<c>FindByLocation</c> returns an empty (non-null) collection when no patient is associated with the specified location.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=ca32bb9 body=fbf72c8 -->
|
||||
[Test]
|
||||
public async Task FindByLocation_Not_Find_Patient_Return_Null()
|
||||
{
|
||||
@@ -170,6 +178,7 @@ public class AppointmentRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <see cref="AppointmentRepository.FindByLocation"/> successfully retrieves the appointment associated with a patient located at the specified <see cref="PatientLocation"/>.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=531bfca body=5f2109a -->
|
||||
[Test]
|
||||
public async Task FindByLocation_Find_Patient_Return_Appointment()
|
||||
{
|
||||
|
||||
@@ -27,6 +27,7 @@ public class ConfigObservationRepositoryTest
|
||||
/// system references, original name mappings, and observations with min/max alert thresholds
|
||||
/// and forced alert behavior.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=14402f7 -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -123,6 +124,7 @@ public class ConfigObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's FindById method returns a non-null configuration result when queried with a valid id.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=90db18c body=1df1e1d -->
|
||||
[Test]
|
||||
public async Task FindById_Find_Id_Return_Configs()
|
||||
{
|
||||
@@ -134,6 +136,7 @@ public class ConfigObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the <c>FindById</c> repository method returns <c>null</c> when invoked with a newly generated, non-existing identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=ec16c67 body=c6d06bf -->
|
||||
[Test]
|
||||
public async Task FindById_Not_Find_Id_Return_Empty()
|
||||
{
|
||||
@@ -145,6 +148,7 @@ public class ConfigObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that an existing <see cref="ConfigObservation"/> can be retrieved by its identifier and subsequently updated, ensuring the updated entity reflects the new values.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=920dd57 body=d0216be -->
|
||||
[Test]
|
||||
public async Task Update_Find_Id_Return_Update_Configs()
|
||||
{
|
||||
@@ -170,6 +174,7 @@ public class ConfigObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's Update operation creates a new record when the provided identifier does not exist in the data store, instead of failing.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=26cbb5c body=e514eb3 -->
|
||||
[Test]
|
||||
public async Task Update_Not_Find_Id_Create_It()
|
||||
{
|
||||
@@ -192,6 +197,7 @@ public class ConfigObservationRepositoryTest
|
||||
/// Verifies that the base delete operation removes a <see cref="ConfigObservation"/> from the repository.
|
||||
/// The test confirms the entity is absent before insertion, present after insertion, and absent again after deletion.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=59f0dda body=38d51c3 -->
|
||||
[Test]
|
||||
public async Task Delete_With_Base_DeleteAsync()
|
||||
{
|
||||
|
||||
@@ -21,6 +21,7 @@ public class ConfigPumpsRepositoryTest
|
||||
/// <summary>
|
||||
/// Initializes the integration test environment by recreating the config_pumps collection and inserting a single configuration pump containing two empty items for use by subsequent tests.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=6340da1 -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -56,6 +57,7 @@ public class ConfigPumpsRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <see cref="ConfigPumpsRepository.FindById"/> returns a non-null result when searching by the identifier "PV1".
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=670411f body=fce7952 -->
|
||||
[Test]
|
||||
public async Task FindById_Find_id_Return_List()
|
||||
{
|
||||
@@ -67,6 +69,7 @@ public class ConfigPumpsRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's FindById method returns null when no entity is found for the specified identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=97e50f0 body=5c74259 -->
|
||||
[Test]
|
||||
public async Task FindAsync_not_Find_id_Return_Empty_List()
|
||||
{
|
||||
@@ -78,6 +81,7 @@ public class ConfigPumpsRepositoryTest
|
||||
/// <summary>
|
||||
/// Tests that inserting a new pump configuration with two items increases the total configuration count to two, that the inserted configuration can be retrieved by its identifier, and that the inserted configuration can be successfully deleted.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=31a6d19 body=72a4a2d -->
|
||||
[Test]
|
||||
public async Task Insert_PumpConfig_returns2()
|
||||
{
|
||||
|
||||
@@ -19,6 +19,7 @@ public class ConfigUnitsRepositoryTest
|
||||
/// <summary>
|
||||
/// Performs one-time setup for integration tests by resetting the <c>config_units</c> collection and seeding it with a single <see cref="ConfigUnits"/> document (Id "PV1") containing two empty <see cref="ConfigUnitItem"/> entries, then initializes the <see cref="ConfigUnitsRepository"/> used by the tests.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=726ef0c -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -54,6 +55,7 @@ public class ConfigUnitsRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's <c>FindById</c> method returns a non-null result when searching by the identifier "PV1".
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=670411f body=fce7952 -->
|
||||
[Test]
|
||||
public async Task FindById_Find_id_Return_List()
|
||||
{
|
||||
@@ -65,6 +67,7 @@ public class ConfigUnitsRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <see cref="ConfigUnitsRepository.FindById"/> returns null when invoked with an identifier ("PV2") that does not exist in the repository.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=97e50f0 body=5c74259 -->
|
||||
[Test]
|
||||
public async Task FindAsync_not_Find_id_Return_Empty_List()
|
||||
{
|
||||
|
||||
@@ -24,6 +24,7 @@ public class DiagnosisArchiveRepositoryTest
|
||||
/// archive collection in the integration database, and configuring the diagnosis archive
|
||||
/// repository used by the test suite.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=d9aae18 -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -85,6 +86,7 @@ public class DiagnosisArchiveRepositoryTest
|
||||
/// for a given patient that were created before the specified cutoff date, while preserving records
|
||||
/// created on or after that date.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d3a5eeb body=4aa6f1c -->
|
||||
[Test]
|
||||
public async Task DeleteBeforeDate()
|
||||
{
|
||||
|
||||
@@ -22,6 +22,7 @@ public class DiagnosisRepositoryTest
|
||||
/// <summary>
|
||||
/// One-time test setup that prepares the integration database for patient diagnosis tests by dropping and recreating the diagnoses collection, inserting three sample <see cref="PatientDiagnosis"/> records (one with predefined test identifiers and two with auto-generated identifiers), and initializing the <see cref="DiagnosisRepository"/> under test.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=df3edc3 -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -81,6 +82,7 @@ public class DiagnosisRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository returns a non-null and non-empty collection when retrieving records for an existing patient.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=b07f445 body=1ecc19f -->
|
||||
[Test]
|
||||
public async Task GetByPatient_Find_Patient_Return_List()
|
||||
{
|
||||
@@ -93,6 +95,7 @@ public class DiagnosisRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <see cref="DiagnosisRepository.GetByPatient"/> returns an empty list when no records are found for the specified patient identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=11046fe body=f92c1ae -->
|
||||
[Test]
|
||||
public async Task GetByPatient_not_Find_Patient_Return_Empty_List()
|
||||
{
|
||||
@@ -106,6 +109,7 @@ public class DiagnosisRepositoryTest
|
||||
/// Verifies that <see cref="DiagnosisRepository.FindByPatientIdAndCode"/> successfully retrieves a diagnosis for an existing patient using the provided patient identifier, diagnosis code, and diagnosis system.
|
||||
/// </summary>
|
||||
/// <returns>A task that represents the asynchronous test execution.</returns>
|
||||
/// <!-- aidoc:v1 sig=a4dcbd2 body=164b3c6 -->
|
||||
[Test]
|
||||
public async Task FindByPatientIdAndCode_Find_Patient_Return_Diagnois()
|
||||
{
|
||||
@@ -118,6 +122,7 @@ public class DiagnosisRepositoryTest
|
||||
/// Verifies that <see cref="DiagnosisRepository.FindByPatientIdAndCode"/> returns <c>null</c> when no patient is found
|
||||
/// for the provided patient identifier, code, and diagnosis system.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=610fb3e body=fb08982 -->
|
||||
[Test]
|
||||
public async Task FindByPatientIdAndCode_not_Find_Patient_Return_null()
|
||||
{
|
||||
@@ -129,6 +134,7 @@ public class DiagnosisRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <see cref="DiagnosisRepository.FindByPatientIdAsync"/> returns a non-null, non-empty list when looking up an existing patient by their identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=93141f2 body=482ec71 -->
|
||||
[Test]
|
||||
public async Task FindByPatientIdAsync_Find_Patient_Return_List()
|
||||
{
|
||||
@@ -141,6 +147,7 @@ public class DiagnosisRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>FindByPatientIdAsync</c> returns a non-null empty list when no patient matches the provided patient ID.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=364bbfc body=f65d98f -->
|
||||
[Test]
|
||||
public async Task FindByPatientIdAsync_not_Find_Patient_Return_Empty_List()
|
||||
{
|
||||
@@ -153,6 +160,7 @@ public class DiagnosisRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>DeleteAsync</c> removes a patient diagnosis record by its identifier: after insertion, the record is retrievable by patient id, and once deleted, the search by patient id returns no results.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=11927cd body=c622103 -->
|
||||
[Test]
|
||||
public async Task DeleteAsync_Find_id()
|
||||
{
|
||||
@@ -181,6 +189,7 @@ public class DiagnosisRepositoryTest
|
||||
/// by inserting a diagnosis, confirming it can be found, deleting it by patient id, and then
|
||||
/// asserting that no diagnoses remain for that patient.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=cecd641 body=81c52b1 -->
|
||||
[Test]
|
||||
public async Task DeleteByPatientId_Find_patientId()
|
||||
{
|
||||
@@ -208,6 +217,7 @@ public class DiagnosisRepositoryTest
|
||||
/// Tests that <c>UpdateManyObjectId</c> correctly updates the <c>PatientId</c> field across all matching <see cref="PatientDiagnosis"/> documents by replacing the original ObjectId with a new one.
|
||||
/// Verifies that after the update, the document can be retrieved using the new patient identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=7bfa39c body=54e7d90 -->
|
||||
[Test]
|
||||
public async Task UpdateManyObjectId_With_base_UpdateManyObjectIdAsync()
|
||||
{
|
||||
|
||||
@@ -23,6 +23,7 @@ public class DischargeRepositoryTest
|
||||
/// <summary>
|
||||
/// Performs one-time test setup for discharge integration tests by initializing API settings, dropping and recreating the "discharge" collection in the integration database, and instantiating the <see cref="DischargeRepository"/>.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=e05a801 -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -43,6 +44,7 @@ public class DischargeRepositoryTest
|
||||
/// Verifies that <c>InsertOneAsync</c> successfully persists a discharge document and that the
|
||||
/// inserted record can be retrieved by its identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=8aeeb12 body=9280cf3 -->
|
||||
[Test]
|
||||
public async Task InsertOneAsync_ShouldInsertDischarge()
|
||||
{
|
||||
@@ -59,6 +61,7 @@ public class DischargeRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the <c>Delete</c> repository operation removes a discharge so that subsequent lookups by its identifier return no result.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=e74d1e2 body=34b5447 -->
|
||||
[Test]
|
||||
public async Task Delete_ShouldDeleteDischarge()
|
||||
{
|
||||
@@ -76,6 +79,7 @@ public class DischargeRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that an existing discharge record is successfully updated in the repository with new field values.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=02a52dc body=6496963 -->
|
||||
[Test]
|
||||
public async Task Update_DischargeSuccessfullyUpdated()
|
||||
{
|
||||
@@ -142,6 +146,7 @@ public class DischargeRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's <c>FindAll</c> method returns all discharge records previously inserted via <c>InsertManyAsync</c>, returning a non-null, non-empty collection whose count matches the number of inserted records.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=127b3ea body=394171b -->
|
||||
[Test]
|
||||
public async Task FindAll_ReturnsAllDischarges()
|
||||
{
|
||||
@@ -167,6 +172,7 @@ public class DischargeRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's <c>FindById</c> method returns the matching <c>Discharge</c> document when queried with an existing identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=7d8ccce body=b1b5625 -->
|
||||
[Test]
|
||||
public async Task FindById_ExistingId_ReturnsDischarge()
|
||||
{
|
||||
@@ -183,6 +189,7 @@ public class DischargeRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the discharge repository's FindById method returns <c>null</c> when queried with a non-existent <see cref="ObjectId"/>.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=697e175 body=a0d5cfe -->
|
||||
[Test]
|
||||
public async Task FindById_NonExistentId_ReturnsNull()
|
||||
{
|
||||
@@ -214,6 +221,7 @@ public class DischargeRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the discharge repository's FindByDestination method returns the matching discharge records when queried with an existing destination.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=a740d08 body=7593742 -->
|
||||
[Test]
|
||||
public async Task FindByDestination_ExistingDestination_ReturnsDischarges()
|
||||
{
|
||||
@@ -236,6 +244,7 @@ public class DischargeRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>FindByDestination</c> returns an empty collection when the provided destination does not match any stored discharge records.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=348dfce body=036788e -->
|
||||
[Test]
|
||||
public async Task FindByDestination_NonExistentDestination_ReturnsEmptyList()
|
||||
{
|
||||
@@ -253,6 +262,7 @@ public class DischargeRepositoryTest
|
||||
/// Verifies that <see cref="DischargeRepository.FindByPoCId"/> returns the matching discharge
|
||||
/// when a discharge is associated with the supplied point-of-care identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81038e3 body=609221c -->
|
||||
[Test]
|
||||
public async Task FindByPoCId_ExistingPoCId_ReturnsDischarges()
|
||||
{
|
||||
@@ -275,6 +285,7 @@ public class DischargeRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the discharge repository's FindByPoCId method returns an empty list when queried with a non-existent PoCId.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d45faee body=ac91c12 -->
|
||||
[Test]
|
||||
public async Task FindByPoCId_NonExistentPoCId_ReturnsEmptyList()
|
||||
{
|
||||
@@ -291,6 +302,7 @@ public class DischargeRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <see cref="DischargeRepository.FindByService"/> returns the matching discharge record when a previously inserted discharge exists for the specified service name.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=e99c892 body=45c1f89 -->
|
||||
[Test]
|
||||
public async Task FindByService_ExistingService_ReturnsDischarges()
|
||||
{
|
||||
@@ -313,6 +325,7 @@ public class DischargeRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>FindByService</c> returns an empty list when queried with a service name that does not exist in the repository.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=dfafcb5 body=cdd509d -->
|
||||
[Test]
|
||||
public async Task FindByService_NonExistentService_ReturnsEmptyList()
|
||||
{
|
||||
@@ -348,6 +361,7 @@ public class DischargeRepositoryTest
|
||||
/// Verifies that <c>GetDischargeByLocation</c> returns <c>null</c> when queried with a location
|
||||
/// that does not exist in the repository.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=e345a93 body=1c5b68f -->
|
||||
[Test]
|
||||
public async Task GetDischargeByLocation_NonExistentLocation_ReturnsNull()
|
||||
{
|
||||
@@ -364,6 +378,7 @@ public class DischargeRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>GetDischargeByPointOfCareId</c> returns the matching <c>Discharge</c> when queried with a point of care ID that already exists in the repository.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=1dff722 body=e61125e -->
|
||||
[Test]
|
||||
public async Task GetDischargeByPointOfCareId_ExistingId_ReturnsDischarge()
|
||||
{
|
||||
@@ -385,6 +400,7 @@ public class DischargeRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>GetDischargeByPointOfCareId</c> returns <c>null</c> when called with a non-existent point of care ID.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=7cb9f72 body=decbb3c -->
|
||||
[Test]
|
||||
public async Task GetDischargeByPointOfCareId_NonExistentId_ReturnsNull()
|
||||
{
|
||||
@@ -402,6 +418,7 @@ public class DischargeRepositoryTest
|
||||
/// Verifies that <c>GetByPatientId</c> returns the matching <see cref="Discharge"/> record
|
||||
/// when a discharge exists for the specified patient identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=1bf90fa body=426641a -->
|
||||
[Test]
|
||||
public async Task GetByPatientId_ExistingPatientId_ReturnsDischarge()
|
||||
{
|
||||
@@ -424,6 +441,7 @@ public class DischargeRepositoryTest
|
||||
/// Verifies that the <see cref="DischargeRepository.GetByPatientId"/> repository method returns <c>null</c>
|
||||
/// when called with a patient ID that does not exist in the data store.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=07ad0d0 body=e034156 -->
|
||||
[Test]
|
||||
public async Task GetByPatientId_NonExistentPatientId_ReturnsNull()
|
||||
{
|
||||
|
||||
@@ -23,6 +23,7 @@ public class DisplayConfigTest
|
||||
/// <summary>
|
||||
/// Performs one-time setup for integration tests by initializing the display configuration, card configuration, and detail configuration repositories with test data, including a valid display configuration, a card configuration, and a nurse card details configuration.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=518646b body=8037c13 -->
|
||||
[OneTimeSetUp]
|
||||
public async Task SetUp()
|
||||
{
|
||||
@@ -59,6 +60,7 @@ public class DisplayConfigTest
|
||||
/// <summary>
|
||||
/// One-time teardown method that cleans up the integration test database by dropping the display configuration collections created during testing.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=2b9e932 body=c1885a2 -->
|
||||
[OneTimeTearDown]
|
||||
public async Task Cleanup()
|
||||
{
|
||||
@@ -79,6 +81,7 @@ public class DisplayConfigTest
|
||||
/// <summary>
|
||||
/// Verifies that retrieving a display configuration by its identifier returns a non-null result with the associated card and detail configurations populated.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=b0680cd body=57902f6 -->
|
||||
[Test]
|
||||
public async Task GetByIdShouldReturnAllConfigsAssociated()
|
||||
{
|
||||
|
||||
@@ -14,6 +14,7 @@ public class DisplayRepisitoryTest
|
||||
/// <summary>
|
||||
/// One-time setup method that resets the "displays" collection in the integration database by dropping and recreating it, ensuring a clean state before integration tests run.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=f7b1b92 body=1664d64 -->
|
||||
[OneTimeSetUp]
|
||||
public async Task OneTimeSetUp()
|
||||
{
|
||||
|
||||
@@ -25,6 +25,7 @@ public class HistoricalConfigChangesRepositoryTest
|
||||
/// <summary>
|
||||
/// Performs one-time setup for the test fixture by initializing configuration options, a mocked logger, and the <see cref="HistoricalConfigChangesRepository"/> instance used across the tests.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=706266c body=5308091 -->
|
||||
[OneTimeSetUp]
|
||||
public void Init()
|
||||
{
|
||||
@@ -39,6 +40,7 @@ public class HistoricalConfigChangesRepositoryTest
|
||||
/// <summary>
|
||||
/// Resets the integration test environment by dropping and recreating the <c>historicalConfigChanges</c> collection and then reinitializing the test data. Used as a teardown step to ensure a clean state between tests.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=7ee5718 body=1347954 -->
|
||||
[TearDown]
|
||||
public async Task Cleanup()
|
||||
{
|
||||
@@ -63,6 +65,8 @@ public class HistoricalConfigChangesRepositoryTest
|
||||
/// Seeds the repository with a series of historical configuration change records for an observation configuration
|
||||
/// (Hemoglobina), illustrating successive code updates from "54321" to "xxxxx" to "11111" to "99999" under the "adas" user.
|
||||
/// </summary>
|
||||
/// <!-- aidoc-review:v1 severity=low kind=wrong_summary
|
||||
/// "The summary states the code progression ends with '11111' to '99999', but in the third record the OldConfig.Code is '111111' (six 1's), not '11111' (five 1's); the values in record 2's NewConfig ('11111') and record 3's OldConfig ('111111') differ." -->
|
||||
private async Task InitializeData()
|
||||
{
|
||||
var id = ObjectId.GenerateNewId();
|
||||
@@ -143,6 +147,7 @@ public class HistoricalConfigChangesRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's <c>FindAll</c> method returns a non-null collection containing exactly three historical configuration change records after a cleanup operation.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=ddd8b40 body=ff905b3 -->
|
||||
[Test]
|
||||
public async Task Get_HistoricalConfigChanges_returns_count_3()
|
||||
{
|
||||
@@ -158,6 +163,7 @@ public class HistoricalConfigChangesRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository <c>Update</c> operation for a <see cref="HistoricalConfigChanges"/> document returns a non-null result whose properties correspond to the updated record, after cleaning up existing data and retrieving an existing entry to be modified.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=4eca1c1 body=4c340da -->
|
||||
[Test]
|
||||
public async Task HistoricalConfigChanges_returns_diferent_document()
|
||||
{
|
||||
@@ -208,6 +214,7 @@ public class HistoricalConfigChangesRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <see cref="_repository"/>.FindLastHistoricalConfigChangesByUser returns exactly three historical configuration changes for the user "adas" after cleanup.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=2af44db body=322238c -->
|
||||
[Test]
|
||||
public async Task FindLastHistoricalConfigChangesByUser_returns_3()
|
||||
{
|
||||
@@ -221,6 +228,7 @@ public class HistoricalConfigChangesRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that deleting a historical config change entry reduces the total count of records from three to two in the repository.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=95e0ef5 body=246dd28 -->
|
||||
[Test]
|
||||
public async Task Delete_HistoricalConfigChanges_returns_count_2()
|
||||
{
|
||||
|
||||
@@ -27,6 +27,7 @@ public class IntegrationDb
|
||||
/// <summary>
|
||||
/// Initializes the MongoDB integration test environment by starting a MongoDB runner, configuring MongoDB conventions and BSON class mappings, establishing a client from the runner's connection string, and obtaining the target database used by integration tests.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=9ae459a body=d277949 -->
|
||||
[OneTimeSetUp]
|
||||
public void InitIntegrationTests()
|
||||
{
|
||||
@@ -42,6 +43,7 @@ public class IntegrationDb
|
||||
/// If the server does not become available within the timeout, the runner is disposed and a <see cref="TimeoutException"/> is thrown.
|
||||
/// </summary>
|
||||
/// <exception cref="TimeoutException">Thrown when the MongoDB server does not respond within the configured timeout period.</exception>
|
||||
/// <!-- aidoc:v1 sig=cd0b7ec body=775a1ab -->
|
||||
private static async Task StartMongoDbRunner()
|
||||
{
|
||||
Runner = MongoDbRunner.Start();
|
||||
@@ -71,6 +73,7 @@ public class IntegrationDb
|
||||
/// Performs one-time teardown for integration tests by disposing the <see cref="Client"/> and <see cref="Runner"/> resources.
|
||||
/// Safely handles cases where either resource has not been initialized by using null-conditional disposal.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=004ce09 body=c8f0617 -->
|
||||
[OneTimeTearDown]
|
||||
public void TeardownIntegrationTests()
|
||||
{
|
||||
|
||||
@@ -17,6 +17,7 @@ public class MasterListRepositoryTest
|
||||
/// <summary>
|
||||
/// Performs one-time initialization for the test fixture by configuring <see cref="ApiSettings"/> with the expected master list property names, resetting the "MasterLists" collection in the integration database, and creating a <see cref="MasterListRepository{MasterList}"/> instance for use across tests.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=18370f8 -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -70,6 +71,7 @@ public class MasterListRepositoryTest
|
||||
/// <summary>
|
||||
/// Performs one-time cleanup after integration test execution by dropping the <c>MasterLists</c> collection from the integration test database to ensure a clean state between test runs.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=2b9e932 body=c9319f6 -->
|
||||
[OneTimeTearDown]
|
||||
public async Task Cleanup()
|
||||
{
|
||||
@@ -85,6 +87,7 @@ public class MasterListRepositoryTest
|
||||
/// Verifies that <see cref="MasterList"/> entities are correctly persisted in the repository via <c>InsertOneAsync</c>,
|
||||
/// by inserting an entity and confirming it can be retrieved by its identifier using the default locale.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=bba0e89 body=0ea8cb9 -->
|
||||
[Test]
|
||||
public async Task InsertOneAsync_ShouldInsertEntity()
|
||||
{
|
||||
@@ -104,6 +107,7 @@ public class MasterListRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's Delete operation successfully removes a MasterList entity, ensuring that a subsequent lookup by id returns no result.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=0b44339 body=e17fa20 -->
|
||||
[Test]
|
||||
public async Task Delete_ShouldDeleteEntity()
|
||||
{
|
||||
@@ -122,6 +126,7 @@ public class MasterListRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's <c>Update</c> method successfully persists changes to an existing <see cref="MasterList"/> entity, allowing the modified record to be retrieved by its identifier with the updated values.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=df0490c body=c7537fa -->
|
||||
[Test]
|
||||
public async Task Update_ShouldUpdateEntity()
|
||||
{
|
||||
@@ -143,6 +148,7 @@ public class MasterListRepositoryTest
|
||||
/// Verifies that the repository's FindById method returns the matching entity when a master list with the specified identifier exists in the data store.
|
||||
/// </summary>
|
||||
/// <returns>A task representing the asynchronous test execution.</returns>
|
||||
/// <!-- aidoc:v1 sig=eb7d5be body=10ec339 -->
|
||||
[Test]
|
||||
public async Task FindById_ShouldReturnEntity_WhenFound()
|
||||
{
|
||||
@@ -269,6 +275,7 @@ public class MasterListRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's FindByName method returns the matching entity when an entity with the specified name exists in the data store.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=e22b4c6 body=4c1dd17 -->
|
||||
[Test]
|
||||
public async Task FindByName_ShouldReturnEntity_WhenFound()
|
||||
{
|
||||
@@ -287,6 +294,7 @@ public class MasterListRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's GetAll method returns all entities, ensuring the result contains at least two items.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=a5d7dd2 body=495d5eb -->
|
||||
[Test]
|
||||
public async Task GetAll_ShouldReturnAllEntities()
|
||||
{
|
||||
|
||||
@@ -22,6 +22,7 @@ public class MedicineRepositoryTest
|
||||
/// <summary>
|
||||
/// Performs one-time initialization for integration tests by seeding the medicines collection with a test record and verifying it can be retrieved by code or note.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=efc0f36 -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -62,6 +63,7 @@ public class MedicineRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>GetMedicineByCodeOrNote</c> returns a non-null, empty list when invoked with an array containing an empty string.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=0e171bf body=07fc7d9 -->
|
||||
[Test]
|
||||
public async Task Get_Medicines_Of_Treatments_Return_Empty_List()
|
||||
{
|
||||
@@ -103,6 +105,7 @@ public class MedicineRepositoryTest
|
||||
/// <summary>
|
||||
/// Tests that the repository returns a non-null medicine when a valid medicine code is found.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=df645bd body=3280632 -->
|
||||
[Test]
|
||||
public async Task GetMedicine_Find_Code_Return_Medicine()
|
||||
{
|
||||
@@ -114,6 +117,7 @@ public class MedicineRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's <c>GetMedicine</c> method returns <c>null</c> when the provided medicine code does not match any existing record.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=65393e1 body=4ad2d58 -->
|
||||
[Test]
|
||||
public async Task GetMedicine_Not_Find_Code_Return_Empty()
|
||||
{
|
||||
@@ -126,6 +130,7 @@ public class MedicineRepositoryTest
|
||||
/// Verifies that the repository returns a non-null medicine when a medicine is found
|
||||
/// by the supplied note identifier ("note1"), confirming successful lookup by note.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=59684de body=fc53426 -->
|
||||
[Test]
|
||||
public async Task GetMedicine_Find_Note_Return_Medicine()
|
||||
{
|
||||
@@ -137,6 +142,7 @@ public class MedicineRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that UpdateMedicine returns the updated medicine and that the changes are persisted and retrievable via GetMedicineById, including the updated notes collection.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=64c3b04 body=e38bac9 -->
|
||||
[Test]
|
||||
public async Task UpdateMedicine_Return_Medicine()
|
||||
{
|
||||
|
||||
@@ -37,6 +37,7 @@ public class MongodbMigrationTest
|
||||
/// <summary>
|
||||
/// Performs one-time initialization for the test fixture by dropping and recreating the "patients" collection, instantiating the PatientRepository, and seeding it with three test Patient records (one of which has a discharge time set to the current time) to verify they are persisted.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=4ef5cc4 -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -102,6 +103,7 @@ public class MongodbMigrationTest
|
||||
/// <summary>
|
||||
/// Performs one-time cleanup after integration tests by dropping the <c>patients</c> and <c>__migrations</c> collections from the integration database, ensuring a clean state for subsequent test runs.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=effc73b body=3589ba1 -->
|
||||
[OneTimeTearDown]
|
||||
public void Teardown()
|
||||
{
|
||||
@@ -112,6 +114,7 @@ public class MongodbMigrationTest
|
||||
/// <summary>
|
||||
/// Verifies that the database is detected as outdated by creating a runner and asserting that <c>IsDatabaseUpToDate</c> returns <c>false</c> when using the primary read preference.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=321f15b body=4973696 -->
|
||||
[Test]
|
||||
[Order(1)]
|
||||
public void IsDatabaseOutdated_ShouldReturnTrue()
|
||||
@@ -127,6 +130,7 @@ public class MongodbMigrationTest
|
||||
/// <summary>
|
||||
/// Verifies that after running the migration update to the latest version, the migration with ID 10 (version 0.1.0) is present among the applied migrations.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=561899c body=96dbaf9 -->
|
||||
[Test]
|
||||
[Order(2)]
|
||||
public void AfterUpdateToLatest_MigrationShouldBeApplied()
|
||||
@@ -159,6 +163,7 @@ public class MongodbMigrationTest
|
||||
/// Creates and configures a <see cref="MigrationRunner"/> for executing database migrations, using a locator that scans the assembly containing the patient data update migration.
|
||||
/// </summary>
|
||||
/// <returns>A configured <see cref="MigrationRunner"/> bound to the integration database and the migrations collection.</returns>
|
||||
/// <!-- aidoc:v1 sig=10bca02 body=74d6fef -->
|
||||
private MigrationRunner CreateRunner()
|
||||
{
|
||||
var locator = new MigrationLocator();
|
||||
@@ -174,6 +179,7 @@ public class MongodbMigrationTest
|
||||
/// Retrieves the identifiers of all applied migrations from the "__migrations" collection in the integration database.
|
||||
/// </summary>
|
||||
/// <returns>A list of migration identifiers extracted from the "_id" field of each migration document.</returns>
|
||||
/// <!-- aidoc:v1 sig=24bca53 body=dc0f87b -->
|
||||
private List<int> GetAppliedMigrationIds()
|
||||
{
|
||||
var collection = IntegrationDb.Database.GetCollection<BsonDocument>("__migrations");
|
||||
|
||||
@@ -77,6 +77,7 @@ public class ObservationArchiveRepositoryTest
|
||||
/// Verifies that the repository's <c>DeleteBeforeDate</c> method removes all patient observations
|
||||
/// dated before the specified cutoff, leaving only a single observation remaining in the collection.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d3a5eeb body=7b01df8 -->
|
||||
[Test]
|
||||
public async Task DeleteBeforeDate()
|
||||
{
|
||||
|
||||
@@ -33,6 +33,7 @@ public class ObservationRepositoryTest
|
||||
/// and seeds it with six <see cref="PatientObservation"/> records covering different codes, coding systems, and timestamps
|
||||
/// (including observations without a <c>SystemId</c>).
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=3e4af03 -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -141,6 +142,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's last observations lookup returns a non-null list containing the expected number of observations for the specified patient, system ("SNM"), and observation code ("code1").
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=88635f6 body=2067a8b -->
|
||||
[Test]
|
||||
public async Task FindLastObservations_Return_List()
|
||||
{
|
||||
@@ -155,6 +157,7 @@ public class ObservationRepositoryTest
|
||||
/// Verifies that FindLastObservationsByCodingSystem returns a non-null list of the expected count
|
||||
/// of the most recent observations for the specified patient filtered by the "SNM" coding system.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=0c960a3 body=f8e4c58 -->
|
||||
[Test]
|
||||
public async Task FindLastObservationsByCodingSystem_Return_List()
|
||||
{
|
||||
@@ -168,6 +171,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the AggregatedPatientLastObservations method returns a non-null list containing the expected number of aggregated last observations for the specified patient.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=1cb45c4 body=0919ea1 -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientLastObservations_Null_Filter_Return_List()
|
||||
{
|
||||
@@ -180,6 +184,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the AggregatedPatientLastObservations repository method returns a non-null filtered list with the expected number of entries when a name filter is provided.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=af78004 body=f4c593b -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientLastObservations_Filter_Return_List()
|
||||
{
|
||||
@@ -194,6 +199,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that AggregatedPatientLastObservations returns an empty list when the provided filter does not match any observations.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=b7e2192 body=ff9f765 -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientLastObservations_Filter_Not_Find_Return_Empty_List()
|
||||
{
|
||||
@@ -208,6 +214,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>AggregatedPatientLastObservationsByLastDate</c> returns a non-null list of aggregated patient last observations for a given patient and date, even when no filter is applied.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=7a118f0 body=2447117 -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientLastObservationsByLastDate_Null_Filter_Return_List()
|
||||
{
|
||||
@@ -220,6 +227,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that _repository.AggregatedPatientLastObservationsByLastDate returns a non-null list containing the expected number of aggregated patient last observations when a filter is provided.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=effae73 body=630b754 -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientLastObservationsByLastDate_Filter_Return_List()
|
||||
{
|
||||
@@ -234,6 +242,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that AggregatedPatientLastObservationsByLastDate returns an empty list when the provided filter does not match any patient observations.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=a861d66 body=68738b9 -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientLastObservationsByLastDate_Filter_Not_Find_Return_Empty_List()
|
||||
{
|
||||
@@ -249,6 +258,7 @@ public class ObservationRepositoryTest
|
||||
/// Verifies that AggregatedPatientLastObservationsByField returns a non-null list of aggregated patient last observations
|
||||
/// when the filter is <c>null</c>, confirming the expected fallback behavior and default result set.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=caf7033 body=c85338e -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientLastObservationsByField_Null_Filter_Return_List()
|
||||
{
|
||||
@@ -261,6 +271,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Tests that filtering aggregated patient last observations by a specific field returns a non-null list containing the expected number of results.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=5917458 body=a5282a6 -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientLastObservationsByField_Filter_Return_List()
|
||||
{
|
||||
@@ -276,6 +287,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that _repository.AggregatedPatientLastObservationsByField returns an empty list when the filter field has <c>OnlyExpired</c> set to <c>true</c>, indicating no expired observations are available for the patient.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=276c465 body=3f97cba -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientLastObservationsByField_Filter_OnlyExpired_Return_Empty_List()
|
||||
{
|
||||
@@ -294,6 +306,7 @@ public class ObservationRepositoryTest
|
||||
/// The test inserts a single observation, confirms it is persisted, deletes it by
|
||||
/// patient id, and asserts that no records remain for that patient.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=79b17ee body=9f320fb -->
|
||||
[Test]
|
||||
public async Task DeleteByPatientId()
|
||||
{
|
||||
@@ -327,6 +340,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that FindByPatientIdAsync returns a non-null cursor containing the expected number of records for the specified patient identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d18d952 body=133ddc6 -->
|
||||
[Test]
|
||||
public async Task FindByPatientIdAsync_Return_Cursor()
|
||||
{
|
||||
@@ -339,6 +353,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <see cref="DeleteAsync"/> correctly removes a patient observation from the repository by inserting a record, confirming its presence, deleting it, and ensuring it is no longer retrievable.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=fff9e82 body=a6a87ee -->
|
||||
[Test]
|
||||
public async Task DeleteAsync()
|
||||
{
|
||||
@@ -372,6 +387,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's <c>DeleteOlderDaysAsync</c> method removes <see cref="PatientObservation"/> records older than the specified day threshold while keeping more recent ones, and that <c>DeleteByPatientId</c> subsequently clears the remaining records associated with the same patient.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=da9fb95 body=8dfd6d6 -->
|
||||
[Test]
|
||||
public async Task DeleteOlderDaysAsync()
|
||||
{
|
||||
@@ -425,6 +441,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>DeleteOlderSecondsAsync</c> removes <c>PatientObservation</c> entries whose timestamp is older than the specified number of seconds, keeping more recent entries with the same name intact, and that <c>DeleteByPatientId</c> clears all remaining observations for the given patient.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=9941ee8 body=377855c -->
|
||||
[Test]
|
||||
public async Task DeleteOlderSecondsAsync()
|
||||
{
|
||||
@@ -479,6 +496,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's <c>DeleteOlderNumberAsync</c> method retains only the most recent specified count of <see cref="PatientObservation"/> records sharing the same name, deleting the older entries, and that <c>DeleteByPatientId</c> subsequently removes all remaining records for the patient.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=340569b body=00db271 -->
|
||||
[Test]
|
||||
public async Task DeleteOlderNumberAsync()
|
||||
{
|
||||
@@ -546,6 +564,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that _repository.<c>ExistBySystemId</c> returns a valid result when checking existence by the given patient and system identifiers.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=4a76800 body=c1adb09 -->
|
||||
[Test]
|
||||
public async Task ExistBySystemId_Return_List()
|
||||
{
|
||||
@@ -558,6 +577,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that FindLastObservationBeforeDate returns a non-null observation whose timestamp is earlier than the specified date, confirming a matching record is retrieved successfully.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=c4f6209 body=029c0ad -->
|
||||
[Test]
|
||||
public async Task FindLastObservationBeforeDate_Return_Obs()
|
||||
{
|
||||
@@ -571,6 +591,7 @@ public class ObservationRepositoryTest
|
||||
/// Verifies that the repository's <c>FindAnyWithSameDate</c> method returns a non-null list containing exactly one observation
|
||||
/// when searching for observations associated with the specified patient, name, and date.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=f4d1d6e body=13ab188 -->
|
||||
[Test]
|
||||
public async Task FindAnyWithSameDate_Return_List_Obs()
|
||||
{
|
||||
@@ -583,6 +604,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Tests that the repository returns a non-null list of two observations for a patient, found before the specified date (yesterday).
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=7625bc5 body=4184aa0 -->
|
||||
[Test]
|
||||
public async Task FindAnyBeforeDate_Return_List_Obs()
|
||||
{
|
||||
@@ -595,6 +617,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that AggregatedPatientActiveIntravenousLinesObservations returns a non-null, empty list of observations for the specified patient when no filter criteria are provided.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=443bc38 body=fa1727f -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientActiveIntravenousLinesObservations_Null_Filter_Return_List_Obs()
|
||||
{
|
||||
@@ -607,6 +630,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that _repository.AggregatedPatientActiveIntravenousLinesObservations returns an empty list of observations when the filter value is not the Patient Intravenous Lines value.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=222e074 body=fa1727f -->
|
||||
[Test]
|
||||
public async Task
|
||||
AggregatedPatientActiveIntravenousLinesObservations_Filter_Not_PatientIntravenousLineasValue_Return_List_Obs()
|
||||
@@ -622,6 +646,7 @@ public class ObservationRepositoryTest
|
||||
/// when filtering by patient id and the observation value is a <c>PatientIntravenousLinesValue</c> instance.
|
||||
/// The test inserts a single matching observation, asserts that exactly one record is returned, and confirms successful cleanup by deletion.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=de0f13c body=e70da59 -->
|
||||
[Test]
|
||||
public async Task
|
||||
AggregatedPatientActiveIntravenousLinesObservations_Filter_PatientIntravenousLineasValue_Return_List_Obs()
|
||||
@@ -663,6 +688,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository method <c>FindAllLastPatientObservationTime</c> returns a non-null collection containing at least one last patient observation time record.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=ae4ea39 body=e0d34c8 -->
|
||||
[Test]
|
||||
public async Task FindAllLastPatientObservationTime_Return_List()
|
||||
{
|
||||
@@ -675,6 +701,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's <c>FindById</c> method returns <c>null</c> when the requested entity does not exist in the data store.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=fa5827c body=aa8e2ed -->
|
||||
[Test]
|
||||
public async Task FindById_Return_null()
|
||||
{
|
||||
@@ -686,6 +713,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's <c>FindById</c> method returns a non-null entity whose identifier matches the requested <c>Id</c>.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=a8a8a1f body=5c4b5c9 -->
|
||||
[Test]
|
||||
public async Task FindById_Return_Obs()
|
||||
{
|
||||
@@ -699,6 +727,7 @@ public class ObservationRepositoryTest
|
||||
/// Verifies that the repository's <c>UpdateExpiredObservations</c> method correctly marks all non-expired observations belonging to a patient as expired.
|
||||
/// The test inserts five fresh observations, asserts that none are expired, invokes the update, and then asserts that all five have been flagged as expired before cleaning up the inserted data.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=b94178a body=272a747 -->
|
||||
[Test]
|
||||
public async Task UpdateExpiredObservations()
|
||||
{
|
||||
@@ -753,6 +782,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's <c>FindAll</c> method returns a non-null and non-empty collection of patient observations.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=b6f854b body=d3aacf4 -->
|
||||
[Test]
|
||||
public async Task FindAll_Return_List_Obs()
|
||||
{
|
||||
@@ -766,6 +796,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's <c>FindNotExpired</c> method returns a non-empty collection of patient observations for the provided observation names.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=8432757 body=44f224f -->
|
||||
[Test]
|
||||
public async Task FindNotExpired_Return_List_Obs()
|
||||
{
|
||||
@@ -781,6 +812,7 @@ public class ObservationRepositoryTest
|
||||
/// configuration observations as expired so that a subsequent _repository.FindNotExpired
|
||||
/// call returns only the remaining non-expired observations, deduplicating the requested names.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=f38e833 body=a355c89 -->
|
||||
[Test]
|
||||
public async Task ExpireExpiredObservations()
|
||||
{
|
||||
@@ -824,6 +856,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's <c>FindByName</c> method returns a non-null, non-empty list of <see cref="PatientObservation"/> objects when searching by the name "name1".
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=4909264 body=8a20493 -->
|
||||
[Test]
|
||||
public async Task FindByName_Return_List_Obs()
|
||||
{
|
||||
@@ -837,6 +870,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>AggregatedPatientGroupedObservations</c> returns a non-null, empty list when called with a default <see cref="GroupedField"/> instance for the given patient.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=ba3950a body=ab60777 -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientGroupedObservations_Null_groupedField_Return_List_Emty()
|
||||
{
|
||||
@@ -855,6 +889,7 @@ public class ObservationRepositoryTest
|
||||
/// are aggregated for a patient using the First result selection strategy with a maximum of 8 groups.
|
||||
/// Verifies successful aggregation and ensures all inserted test observations are removed by patient id.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=ddd2397 body=6da0755 -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientGroupedObservations_Hour_Firs_Return_List_9()
|
||||
{
|
||||
@@ -908,6 +943,7 @@ public class ObservationRepositoryTest
|
||||
/// Inserts 30 observations, asserts the aggregated result count is 8, and confirms cleanup by patient id removes all inserted records.
|
||||
/// </summary>
|
||||
/// <returns>A task that completes when the test finishes, including assertions and cleanup.</returns>
|
||||
/// <!-- aidoc:v1 sig=16bfc4b body=6ec573c -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientGroupedObservations_Hour_Firs_Since_Last_Return_List_8()
|
||||
{
|
||||
@@ -959,6 +995,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that inserting five patient observations with hourly regularity and aggregating them using the first result returns a list of four or five grouped entries, and ensures the inserted observations are removed by patient id.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=b1196b2 body=b383d16 -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientGroupedObservations_Insert_5_Hour_Firs_Return_List_5()
|
||||
{
|
||||
@@ -1010,6 +1047,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>AggregatedPatientGroupedObservations</c> returns a non-empty list when patient observations are grouped by a field with second-level regularity and the aggregation selects only the first result per group, and that the inserted observations are fully removed by the cleanup step.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=979ce59 body=7455833 -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientGroupedObservations_second_Firs_Return_List()
|
||||
{
|
||||
@@ -1060,6 +1098,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the aggregated grouped observations query, configured with minute regularity, the <c>First</c> result and a maximum of 8, returns a list of exactly 8 entries even when 30 underlying observations exist for the patient.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=26e8af5 body=afe533b -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientGroupedObservations_Minute_Firs_Return_List_8()
|
||||
{
|
||||
@@ -1113,6 +1152,7 @@ public class ObservationRepositoryTest
|
||||
/// Also confirms that observations inserted for the test patient are removed by the cleanup step.
|
||||
/// </summary>
|
||||
/// <returns>A task that completes when the aggregation result is validated and the test data is cleaned up.</returns>
|
||||
/// <!-- aidoc:v1 sig=ac82ee8 body=f55a331 -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientGroupedObservations_Day_Firs_Return_List_8()
|
||||
{
|
||||
@@ -1163,6 +1203,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>AggregatedPatientGroupedObservations</c> returns a list of 9 entries containing the "first" marker when grouping 30 patient observations by a shift-regularity field with a max of 8 and <c>Result.First</c> selected, and that all inserted observations are removed by the cleanup call.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=908c690 body=45a4df9 -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientGroupedObservations_Shift_Firs_Return_List_9()
|
||||
{
|
||||
@@ -1216,6 +1257,8 @@ public class ObservationRepositoryTest
|
||||
/// Inserts two observations for each of the last 5 hours (at minutes 15 and 30), runs the aggregation for a new patient, and verifies the result count is 5 and that every entry contains the "last" marker.
|
||||
/// Cleanup is performed by deleting the inserted observations by patient id and asserting that the collection is empty afterwards.
|
||||
/// </summary>
|
||||
/// <!-- aidoc-review:v1 severity=low kind=wrong_summary
|
||||
/// "First sentence states '5 observations are inserted per hour' but the code inserts 2 observations per hour (at minutes 15 and 30) across 5 hours. The subsequent sentence correctly clarifies this." -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientGroupedObservations_Insert_5_Hour_last_Return_List_5()
|
||||
{
|
||||
@@ -1293,6 +1336,7 @@ public class ObservationRepositoryTest
|
||||
/// into hourly groups and returns the sum of values for each hour when five hours of data are inserted.
|
||||
/// </summary>
|
||||
/// <returns>A task that represents the asynchronous test execution.</returns>
|
||||
/// <!-- aidoc:v1 sig=70c846f body=b222435 -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientGroupedObservations_Insert_5_Hour_sum_Return_List_5()
|
||||
{
|
||||
@@ -1377,6 +1421,7 @@ public class ObservationRepositoryTest
|
||||
/// AggregatedPatientGroupedObservations returns a list of five entries, each containing the minimum value of 3.
|
||||
/// Also confirms that observations are cleaned up by patient id after the test executes.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=46c6e82 body=eb3a01b -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientGroupedObservations_Insert_5_Hour_Min_Return_List_5()
|
||||
{
|
||||
@@ -1455,6 +1500,7 @@ public class ObservationRepositoryTest
|
||||
/// maximum value for each group, producing one aggregated result per hour when inserting two observations
|
||||
/// (with different values) for each of five consecutive hours.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=fe72045 body=5459e9e -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientGroupedObservations_Insert_5_Hour_Max_Return_List_5()
|
||||
{
|
||||
@@ -1537,6 +1583,7 @@ public class ObservationRepositoryTest
|
||||
/// Inserts 10 observations across 5 different hours (two per hour with values 5 and 3), verifies the result count is 5, and asserts that each entry contains the "average" field with a value of 3 or 4.
|
||||
/// Cleans up by deleting all observations for the test patient after verification.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=41afdfe body=ac8d03f -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientGroupedObservations_Insert_5_Hour_Average_Return_List_5()
|
||||
{
|
||||
@@ -1619,6 +1666,7 @@ public class ObservationRepositoryTest
|
||||
/// Inserts ten observations (two per hour for five consecutive hours) for a new patient, runs the aggregation, and asserts that the result contains five entries each reporting a count of 1 or 2.
|
||||
/// Also confirms that cleanup via <c>DeleteByPatientId</c> removes the inserted observations for the generated patient.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=86524d8 body=92a501b -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientGroupedObservations_Insert_5_Hour_Count_Return_List_5()
|
||||
{
|
||||
@@ -1701,6 +1749,7 @@ public class ObservationRepositoryTest
|
||||
/// Inserts two sets of observations at different minute offsets across the last five hours, then asserts the aggregation result count matches the expected number of groups and the "all" subset is returned.
|
||||
/// Also validates cleanup by ensuring no observations remain for the test patient after deletion.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=2bb5c5e body=3897462 -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientGroupedObservations_Insert_5_Hour_HalfHour_Return_List_5()
|
||||
{
|
||||
@@ -1794,6 +1843,7 @@ public class ObservationRepositoryTest
|
||||
/// observation value (either 5 or 3 depending on insertion order) and that the inserted test data is
|
||||
/// cleaned up afterwards.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=40fc878 body=161ff4e -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientGroupedObservations_Insert_5_Hour_LastFilled_Return_List_5()
|
||||
{
|
||||
@@ -1876,6 +1926,7 @@ public class ObservationRepositoryTest
|
||||
/// <summary>
|
||||
/// Tests that the repository's aggregated patient grouped observations, configured with hourly regularity and the LastAll result option, returns a list of 5 entries when 5 hours of data are inserted (with two observations per hour at minutes 15 and 31), and verifies that cleanup by patient ID removes all inserted records.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=03215f8 body=3230a69 -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientGroupedObservations_Insert_5_Hour_LastAll_Return_List_5()
|
||||
{
|
||||
|
||||
@@ -23,6 +23,7 @@ public class PatientArchiveRepositoryTest
|
||||
/// Performs one-time setup for integration tests by seeding the patient archive collection
|
||||
/// with three predefined <see cref="Patient"/> records after resetting the collection.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=325d090 -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -92,6 +93,7 @@ public class PatientArchiveRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the FindByPatientNumber repository method returns null when no record is found for the provided patient number.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=34ec3bc body=1ed0bbb -->
|
||||
[Test]
|
||||
public async Task FindByPatientNumber_Not_Find_Return_null()
|
||||
{
|
||||
@@ -105,6 +107,7 @@ public class PatientArchiveRepositoryTest
|
||||
/// matching the provided patient number, ensuring the returned patient is not null and has
|
||||
/// the expected PatientNumber.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=c0d3b04 body=73af217 -->
|
||||
[Test]
|
||||
public async Task FindByPatientNumber_Find_Return_Patient()
|
||||
{
|
||||
@@ -117,6 +120,7 @@ public class PatientArchiveRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's <c>FindAll</c> method returns a non-null list containing the expected number of patient records.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d5ae514 body=7b8d43f -->
|
||||
[Test]
|
||||
public async Task FindAll_Return_List_Patients()
|
||||
{
|
||||
|
||||
@@ -31,6 +31,7 @@ public class PatientRepositoryTest
|
||||
/// list records, then verifies that the initial bulk insert yields exactly five patient
|
||||
/// documents.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=e3a0acd -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -239,6 +240,7 @@ public class PatientRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that _repository.FindInActivePoC returns a non-null result containing exactly three inactive PoC entries.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=511005a body=96a1c82 -->
|
||||
[Test]
|
||||
public async Task FindInActivePoC()
|
||||
{
|
||||
@@ -251,6 +253,7 @@ public class PatientRepositoryTest
|
||||
/// Verifies that _repository.FindInInactivePoC() returns a non-null collection containing exactly two inactive PoC records.
|
||||
/// </summary>
|
||||
/// <returns>A Task representing the asynchronous test execution.</returns>
|
||||
/// <!-- aidoc:v1 sig=00839fb body=3eb509a -->
|
||||
[Test]
|
||||
public async Task FindInInactivePoC()
|
||||
{
|
||||
@@ -262,6 +265,7 @@ public class PatientRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that FindById returns the expected <c>Patient</c> when a valid patient identifier is provided, ensuring the result is not null and the <c>PatientNumber</c> matches the expected value.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=4d059ea body=2e321e5 -->
|
||||
[Test]
|
||||
public async Task FindById_Find_Return_Patient()
|
||||
{
|
||||
@@ -274,6 +278,7 @@ public class PatientRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's <c>FindByPatientNumber</c> method returns <c>null</c> when invoked with an empty patient number, confirming the not-found scenario for blank input.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=3dd54bc body=1ed0bbb -->
|
||||
[Test]
|
||||
public async Task FindByPatientNumber_Not_Find_Return_Patient()
|
||||
{
|
||||
@@ -287,6 +292,7 @@ public class PatientRepositoryTest
|
||||
/// a patient when called with a valid patient number, returning a non-null result
|
||||
/// with a matching <c>PatientNumber</c>.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=c0d3b04 body=73af217 -->
|
||||
[Test]
|
||||
public async Task FindByPatientNumber_Find_Return_Patient()
|
||||
{
|
||||
@@ -299,6 +305,7 @@ public class PatientRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's <c>FindAll</c> method returns a non-null list containing all expected patient records (five entries).
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d5ae514 body=c6cf2c0 -->
|
||||
[Test]
|
||||
public async Task FindAll_Return_List_Patients()
|
||||
{
|
||||
@@ -314,6 +321,7 @@ public class PatientRepositoryTest
|
||||
/// the new value is not present prior to the update operation. Also validates that the updated record
|
||||
/// is persisted with the modified value and that the patient can be cleaned up via <c>Delete</c>.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=47a1bec body=826570a -->
|
||||
[Test]
|
||||
public async Task Update_with_base_UpdateOneAsync()
|
||||
{
|
||||
@@ -367,6 +375,7 @@ public class PatientRepositoryTest
|
||||
/// Verifies that a patient can be successfully deleted from the repository by inserting a patient,
|
||||
/// confirming it exists, deleting it, and then confirming it is no longer retrievable.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=122f4c1 body=bdb3f7b -->
|
||||
[Test]
|
||||
public async Task Delete()
|
||||
{
|
||||
@@ -439,6 +448,7 @@ public class PatientRepositoryTest
|
||||
/// Tests that the attending doctor of a point of care entry can be successfully updated with a new doctor.
|
||||
/// Verifies that after the update, the entry retrieved by point of care reflects the new attending doctor's information.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=6f5c72a body=7989ba8 -->
|
||||
[Test]
|
||||
public async Task UpdateAttendingDoctor()
|
||||
{
|
||||
@@ -629,6 +639,7 @@ public class PatientRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that _repository.FindByPatientId returns <c>null</c> when no patient is found for the provided patient identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=2ee2a87 body=5435f7d -->
|
||||
[Test]
|
||||
public async Task FindByPatientId_Not_Find_Return_Patient()
|
||||
{
|
||||
@@ -649,6 +660,7 @@ public class PatientRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository returns a non-null and non-empty collection of patients when searching by the identifier of an existing point of care.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=3c4dd97 body=12ec03f -->
|
||||
[Test]
|
||||
public async Task FindByPointOfCare_Find_Return_Patients()
|
||||
{
|
||||
@@ -662,6 +674,7 @@ public class PatientRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that _repository.FindByPointOfCare returns a non-null empty collection when no patients match the provided point of care identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=ddb2f09 body=bc4f7e5 -->
|
||||
[Test]
|
||||
public async Task FindByPointOfCare_Not_Find_Return_Patients()
|
||||
{
|
||||
@@ -674,6 +687,7 @@ public class PatientRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository returns a non-null and non-empty collection of discharged patients when calling <c>FindDischargedPatients</c>.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=35a586f body=e6a17fd -->
|
||||
[Test]
|
||||
public async Task FindDischargedPatients_Find_Return_Patients()
|
||||
{
|
||||
|
||||
@@ -20,6 +20,7 @@ public class PoCMappingRepositoryTest
|
||||
/// <summary>
|
||||
/// Performs one-time setup for integration tests by seeding the "mappings" collection with a sample <see cref="PoCMapping"/> document, where a single point of care is mapped from an original value to a new one across eleven bed entries, and initializing the <see cref="PoCMappingRepository"/> against the integration database.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=cf0b9af -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -71,6 +72,7 @@ public class PoCMappingRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that finding a mapping by the key "PV1" returns a non-null result containing point of care entries with at least one associated bed.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=2e75ef3 body=918af14 -->
|
||||
[Test]
|
||||
public async Task FindByKey_Find_Return_Mapping()
|
||||
{
|
||||
@@ -84,6 +86,7 @@ public class PoCMappingRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's FindByKey method returns null when the provided key does not correspond to an existing entity, confirming the not-found behavior.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=7839679 body=2c9e795 -->
|
||||
[Test]
|
||||
public async Task FindByKey_Not_Find_Return_Mapping()
|
||||
{
|
||||
|
||||
@@ -21,6 +21,7 @@ public class PoCSettingsRepositoryTest
|
||||
/// <summary>
|
||||
/// One-time setup that prepares the integration test environment by resetting the PoC settings collection in the integration database, seeding it with test data, and instantiating the <see cref="PoCSettingsRepository"/> used by the test fixture.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=dcc8a2f -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -55,6 +56,7 @@ public class PoCSettingsRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that calling the Delete method with an existing PoCSettings identifier removes the corresponding record from the repository, resulting in a null lookup via FindById.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=fe40c5f body=05bfdc8 -->
|
||||
[Test]
|
||||
public async Task Delete_WhenCalled_ShouldRemovePoCSettings()
|
||||
{
|
||||
@@ -78,6 +80,7 @@ public class PoCSettingsRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's <c>FindAll</c> method returns a non-null and non-empty collection of PoC settings.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=7098a75 body=efda3dd -->
|
||||
[Test]
|
||||
public async Task FindAll_WhenCalled_ShouldReturnAllPoCSettings()
|
||||
{
|
||||
@@ -92,6 +95,7 @@ public class PoCSettingsRepositoryTest
|
||||
/// <summary>
|
||||
/// Tests that FindById returns a non-null PoC settings object whose identifier matches the requested value.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d657f65 body=3e8fc10 -->
|
||||
[Test]
|
||||
public async Task FindById_WhenCalled_ShouldReturnPoCSettings()
|
||||
{
|
||||
@@ -106,6 +110,7 @@ public class PoCSettingsRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that _repository.FindByLocation returns a PoC settings object matching the requested patient location.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=ad74af5 body=0b6fc4b -->
|
||||
[Test]
|
||||
public async Task FindByLocation_WhenCalled_ShouldReturnPoCSettings()
|
||||
{
|
||||
@@ -121,6 +126,7 @@ public class PoCSettingsRepositoryTest
|
||||
/// Verifies that the repository correctly updates an existing PoCSettings entity, specifically ensuring that the associated PatientLocation properties (such as Bed) are persisted after the update operation.
|
||||
/// </summary>
|
||||
/// <returns>A task that represents the asynchronous test execution.</returns>
|
||||
/// <!-- aidoc:v1 sig=767a442 body=1a3df29 -->
|
||||
[Test]
|
||||
public async Task Update_WhenCalled_ShouldUpdatePoCSettings()
|
||||
{
|
||||
|
||||
@@ -25,6 +25,7 @@ public class PointOfCareRepositoryTests
|
||||
/// Performs one-time setup for integration tests by initializing mock dependencies and resetting the
|
||||
/// "pointOfCares" MongoDB collection before instantiating the <see cref="PointOfCareRepository"/>.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=9ad8f9b -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -47,6 +48,7 @@ public class PointOfCareRepositoryTests
|
||||
/// <summary>
|
||||
/// Verifies that InsertOneAsync successfully inserts a valid point of care into the repository and that the record can be retrieved by its identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=00a9141 body=70e9995 -->
|
||||
[Test]
|
||||
public async Task InsertOneAsync_ValidPointOfCare_InsertsSuccessfully()
|
||||
{
|
||||
@@ -65,6 +67,7 @@ public class PointOfCareRepositoryTests
|
||||
/// Verifies that the Delete method successfully removes a point of care from the repository when given a valid identifier.
|
||||
/// Inserts a point of care, deletes it by its identifier, and asserts that the entity can no longer be retrieved.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=9eb1fdd body=846deca -->
|
||||
[Test]
|
||||
public async Task Delete_ValidId_DeletesSuccessfully()
|
||||
{
|
||||
@@ -81,6 +84,7 @@ public class PointOfCareRepositoryTests
|
||||
/// <summary>
|
||||
/// Verifies that <see cref="PointOfCare"/> entities can be updated successfully when valid data is provided, ensuring that modified properties such as <c>Room</c> and <c>Bed</c> are persisted and retrievable after the update operation.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=99cfbc0 body=7b6162a -->
|
||||
[Test]
|
||||
public async Task Update_ValidPointOfCare_UpdatesSuccessfully()
|
||||
{
|
||||
@@ -108,6 +112,7 @@ public class PointOfCareRepositoryTests
|
||||
/// <summary>
|
||||
/// Verifies that the repository's <c>FindById</c> method returns the correct <c>PointOfCare</c> document when queried with an existing identifier, by inserting a document and asserting that the retrieved entity matches the expected one.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d0f97dc body=a90f309 -->
|
||||
[Test]
|
||||
public async Task FindById_ExistingId_ReturnsPointOfCare()
|
||||
{
|
||||
@@ -131,6 +136,7 @@ public class PointOfCareRepositoryTests
|
||||
/// <summary>
|
||||
/// Verifies that FindByUnitAndStatus returns the matching <c>PointOfCare</c> documents when queried with an existing unit identifier and status.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=1ec4a01 body=7d0923f -->
|
||||
[Test]
|
||||
public async Task FindByUnitAndStatus_ExistingUnitAndStatus_ReturnsMatchingPointOfCares()
|
||||
{
|
||||
@@ -156,6 +162,7 @@ public class PointOfCareRepositoryTests
|
||||
/// Inserts a valid <c>PointOfCare</c> into the repository and verifies the search by room returns a non-null collection
|
||||
/// containing the expected entity. Assertions are only executed when the inserted <c>PointOfCare</c> has a non-null <c>Unit</c>.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=b29834f body=5f527db -->
|
||||
[Test]
|
||||
public async Task FindByRoom_ValidRoom_ReturnsMatchingPointOfCares()
|
||||
{
|
||||
@@ -180,6 +187,7 @@ public class PointOfCareRepositoryTests
|
||||
/// <summary>
|
||||
/// Verifies that the repository returns the matching PointOfCare when queried with a valid bed identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=ee4a489 body=e8d8078 -->
|
||||
[Test]
|
||||
public async Task FindByBed_ValidBed_ReturnsMatchingPointOfCares()
|
||||
{
|
||||
@@ -203,6 +211,7 @@ public class PointOfCareRepositoryTests
|
||||
/// <summary>
|
||||
/// Verifies that the <c>GetAll</c> repository method returns all stored <c>PointOfCare</c> entries, including a newly inserted one identified by its assigned Id.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=054a987 body=913ed8f -->
|
||||
[Test]
|
||||
public async Task GetAll_ReturnsAllPointOfCares()
|
||||
{
|
||||
|
||||
@@ -36,6 +36,8 @@ public class PumpAlarmEventRepositoryTest
|
||||
/// alarm events covering both Device and DeviceB across attention and occlusion
|
||||
/// alarm types. Verifies that exactly three documents are present after seeding.
|
||||
/// </summary>
|
||||
/// <!-- aidoc-review:v1 severity=low kind=wrong_summary
|
||||
/// "The summary mentions 'covering both Device and DeviceB' instead of 'DeviceA and DeviceB' (DeviceA actually has 2 of the 3 seeded events)" -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -96,6 +98,7 @@ public class PumpAlarmEventRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that InsertAsync correctly persists a <see cref="PumpAlarmEvent"/> to the repository by inserting an event and confirming it can be retrieved by its identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=2215003 body=c74afba -->
|
||||
[Test]
|
||||
public async Task InsertAsync_Works()
|
||||
{
|
||||
@@ -120,6 +123,7 @@ public class PumpAlarmEventRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>FindByDeviceIdAsync</c> returns a non-empty collection of records for the specified device, ordered by time so that the most recent entry appears first.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=01527dc body=aa6b0c8 -->
|
||||
[Test]
|
||||
public async Task FindByDeviceIdAsync_ReturnsOrdered()
|
||||
{
|
||||
@@ -137,6 +141,7 @@ public class PumpAlarmEventRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>FindByDeviceIdAsync</c> returns only pump alarm events whose timestamps fall within the specified date range.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=181c278 body=5238e21 -->
|
||||
[Test]
|
||||
public async Task FindByDeviceIdAsync_WithDateRange_Works()
|
||||
{
|
||||
@@ -156,6 +161,7 @@ public class PumpAlarmEventRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>FindByDeviceIdAsync</c> returns at most the specified number of results when a limit is provided.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=88ed78c body=d3ad079 -->
|
||||
[Test]
|
||||
public async Task FindByDeviceIdAsync_WithLimit_Works()
|
||||
{
|
||||
@@ -195,6 +201,7 @@ public class PumpAlarmEventRepositoryTest
|
||||
/// Verifies that DeleteByPatientId correctly removes all alarm events associated with a given patient.
|
||||
/// Inserts a sample <c>PumpAlarmEvent</c> for a specific patient, deletes it by patient ID, and asserts that no matching events remain in the collection.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d53a759 body=f0c6227 -->
|
||||
[Test]
|
||||
public async Task DeleteByPatientId_Works()
|
||||
{
|
||||
@@ -224,6 +231,7 @@ public class PumpAlarmEventRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>UpdateManyObjectIdByFiledNameAsync</c> correctly updates documents matching the specified field name and old ObjectId value, replacing it with the new ObjectId, and that the changes are persisted and queryable.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=de41de1 body=b093999 -->
|
||||
[Test]
|
||||
public async Task UpdateManyObjectIdByFiledNameAsync_Works()
|
||||
{
|
||||
@@ -252,6 +260,7 @@ public class PumpAlarmEventRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>FindByDeviceIdAsync</c> returns an empty result when the queried date range falls outside of the available data window.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=1cb5677 body=2bd06ed -->
|
||||
[Test]
|
||||
public async Task FindByDeviceIdAsync_ReturnsEmpty_WhenOutOfRange()
|
||||
{
|
||||
@@ -267,6 +276,7 @@ public class PumpAlarmEventRepositoryTest
|
||||
/// Verifies that <c>FindByDeviceIdAsync</c> correctly applies the requested limit and orders results so that the most recent alarm event for the given device is returned first.
|
||||
/// Seeds multiple events for the target device, requests a single record, and asserts that the returned entry matches the latest event retrieved by <c>FindLastByDeviceIdAsync</c>.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=0ace983 body=f479d09 -->
|
||||
[Test]
|
||||
public async Task FindByDeviceIdAsync_RespectsLimitAndOrder()
|
||||
{
|
||||
@@ -292,6 +302,7 @@ public class PumpAlarmEventRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that InsertAsync successfully persists a <see cref="PumpAlarmEvent"/> when its optional fields (<c>PatientId</c> and <c>AlarmType</c>) are <c>null</c>, and that the record can be retrieved afterwards.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=6674243 body=d84c3f0 -->
|
||||
[Test]
|
||||
public async Task InsertAsync_AllowsNullOptionalFields()
|
||||
{
|
||||
@@ -313,6 +324,7 @@ public class PumpAlarmEventRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>DeleteByPatientId</c> removes all alarm events associated with the given patient and can be invoked repeatedly without throwing once the records no longer exist.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=2c04cf9 body=6548dfc -->
|
||||
[Test]
|
||||
public async Task DeleteByPatientId_DeletesMany_AndIsIdempotent()
|
||||
{
|
||||
@@ -342,6 +354,7 @@ public class PumpAlarmEventRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>UpdateManyObjectIdByFiledNameAsync</c> updates the <c>PatientId</c> field from an old <see cref="ObjectId"/> to a new one across all matching documents, returning the modified count and persisting the new identifier in the collection.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=898d198 body=909945a -->
|
||||
[Test]
|
||||
public async Task UpdateManyObjectIdByFiledNameAsync_UpdatesMultiple()
|
||||
{
|
||||
@@ -373,6 +386,7 @@ public class PumpAlarmEventRepositoryTest
|
||||
/// ensuring events whose timestamp matches the upper bound exactly are returned and that all returned
|
||||
/// events fall within the supplied range.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=21f5b81 body=0975796 -->
|
||||
[Test]
|
||||
public async Task FindByDeviceIdAsync_InclusiveRange_BoundsRespected()
|
||||
{
|
||||
@@ -403,6 +417,7 @@ public class PumpAlarmEventRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that FindLastByDeviceIdAsync returns the most recent alarm event for a given device and tracks newly inserted events as the latest entry.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d24d18d body=a473c62 -->
|
||||
[Test]
|
||||
public async Task FindLastByDeviceIdAsync_TracksNewest()
|
||||
{
|
||||
@@ -428,6 +443,7 @@ public class PumpAlarmEventRepositoryTest
|
||||
/// and time range when multiple queries are issued against overlapping windows, ensuring each
|
||||
/// range returns only the event that falls within its boundaries.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=62e28e4 body=55ca12b -->
|
||||
[Test]
|
||||
public async Task FindByDeviceIdAsync_MultipleOverlappingRanges()
|
||||
{
|
||||
|
||||
@@ -34,6 +34,7 @@ public class PumpAlarmStateRepositoryTest
|
||||
/// One-time setup that prepares the integration test environment for <see cref="PumpAlarmStateRepository"/>.
|
||||
/// Configures the API settings, drops and recreates the "pump_alarm_state" collection, instantiates the repository with its indexes, and seeds three initial alarm state records across two devices, verifying the seeded count.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=321fe16 -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -96,6 +97,7 @@ public class PumpAlarmStateRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>FindActiveAsync</c> returns the correct active alarm matching the specified device identifier, alarm type, and alarm code.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=6e7817c body=1072320 -->
|
||||
[Test]
|
||||
public async Task FindActiveAsync_ReturnsCorrectAlarm()
|
||||
{
|
||||
@@ -113,6 +115,7 @@ public class PumpAlarmStateRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>FindActiveAsync</c> returns <c>null</c> when no active alarm matching the specified device, alarm type, and identifier exists.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=448af76 body=5d7c302 -->
|
||||
[Test]
|
||||
public async Task FindActiveAsync_ReturnsNull_WhenNotFound()
|
||||
{
|
||||
@@ -128,6 +131,7 @@ public class PumpAlarmStateRepositoryTest
|
||||
/// when no existing alarm with the same device, type, and code is found, and that the inserted alarm
|
||||
/// can subsequently be retrieved via <c>FindActiveAsync</c>.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=df40b99 body=b502791 -->
|
||||
[Test]
|
||||
public async Task UpsertActiveAsync_InsertsNew()
|
||||
{
|
||||
@@ -179,6 +183,7 @@ public class PumpAlarmStateRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>RemoveAsync</c> correctly deletes an active alarm by device, alarm type, and alarm code, and that a subsequent lookup returns no result.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=7cec1b8 body=57f46a1 -->
|
||||
[Test]
|
||||
public async Task RemoveAsync_Works()
|
||||
{
|
||||
@@ -207,6 +212,7 @@ public class PumpAlarmStateRepositoryTest
|
||||
/// Verifies that the repository's <c>DeleteByPatientId</c> method successfully removes a previously upserted
|
||||
/// <see cref="PumpAlarmState"/> for the specified patient, ensuring no matching records remain in the collection.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d53a759 body=f655df6 -->
|
||||
[Test]
|
||||
public async Task DeleteByPatientId_Works()
|
||||
{
|
||||
@@ -236,6 +242,7 @@ public class PumpAlarmStateRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>FindAllActiveByDeviceAsync</c> returns only active pump alarm states that belong to the specified device.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=5c3d431 body=6ed6d8e -->
|
||||
[Test]
|
||||
public async Task FindAllActiveByDeviceAsync_ReturnsCorrect()
|
||||
{
|
||||
@@ -254,6 +261,7 @@ public class PumpAlarmStateRepositoryTest
|
||||
/// from the old ObjectId to a new ObjectId for matching documents, returning the expected count of
|
||||
/// updated records and making the document retrievable by the new ObjectId.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=ed519f8 body=169b572 -->
|
||||
[Test]
|
||||
public async Task UpdateManyObjectIdByFieldNameAsync_Works()
|
||||
{
|
||||
@@ -312,6 +320,7 @@ public class PumpAlarmStateRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that UpsertActiveAsync correctly inserts a PumpAlarmState record when the AlarmCodeMdc is null, and that the record can be retrieved via FindActiveAsync using a null alarm code.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=1cd185f body=08dbadd -->
|
||||
[Test]
|
||||
public async Task UpsertActiveAsync_InsertsWhenAlarmCodeIsNull()
|
||||
{
|
||||
@@ -336,6 +345,7 @@ public class PumpAlarmStateRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>RemoveAsync</c> removes every active alarm matching the specified device identifier and alarm type, not just a single record.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=e06229e body=5ac9fd3 -->
|
||||
[Test]
|
||||
public async Task RemoveAsync_RemovesAllMatching()
|
||||
{
|
||||
|
||||
@@ -192,6 +192,7 @@ public class PumpArchiveRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the <c>DeleteBeforeDate</c> repository method removes all records with a date earlier than the specified cutoff, retaining only records dated on or after that cutoff.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d3a5eeb body=b97504a -->
|
||||
[Test]
|
||||
public async Task DeleteBeforeDate()
|
||||
{
|
||||
|
||||
@@ -219,6 +219,8 @@ public class PumpObservationRepositoryTest
|
||||
/// Verifies that the aggregated last observations retrieved for the test <c>PatientId</c> are distinct by name, ensuring the resulting collection is non-empty and contains at most two entries.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=878cf7b body=9a03f04 -->
|
||||
/// <!-- aidoc-review:v1 severity=medium kind=wrong_summary
|
||||
/// "The summary states the test 'verifies that the aggregated last observations... are distinct by name', but the assertions only check that the result is non-empty and has at most two entries — no distinctness-by-name check is performed." -->
|
||||
[Test]
|
||||
public async Task AggregatedPatientLastObservations_DistinctByName()
|
||||
{
|
||||
@@ -309,6 +311,8 @@ public class PumpObservationRepositoryTest
|
||||
/// Verifies that <see cref="_repo.DeleteKeepLastNAsync"/> correctly deletes the older records while preserving the most recent <paramref name="n"/> entries, returning the expected count of deleted items.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=6f857ff body=814bec4 -->
|
||||
/// <!-- aidoc-review:v1 severity=low kind=wrong_param_role
|
||||
/// "<paramref name=\"n\"/> references a parameter named 'n' but the test method DeleteKeepLastNAsync_Works has no parameters; 'n' is actually an argument passed to the called method DeleteKeepLastNAsync(3)." -->
|
||||
[Test]
|
||||
public async Task DeleteKeepLastNAsync_Works()
|
||||
{
|
||||
|
||||
@@ -35,6 +35,7 @@ public class PumpStateRepositoryTest
|
||||
/// "pump_states" MongoDB collection, building the repository indexes, and seeding two initial pump states (one
|
||||
/// actively infusing for a known patient/device and one not infusing) to verify the baseline document count.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=a2190cd -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -89,6 +90,7 @@ public class PumpStateRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that FindByDeviceIdAsync retrieves the correct infusion state for a given device, returning a non-null result that matches the requested device identifier and reflects the expected infusion status.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=e52b862 body=d7db598 -->
|
||||
[Test]
|
||||
public async Task FindByDeviceIdAsync_ReturnsCorrectState()
|
||||
{
|
||||
@@ -108,6 +110,7 @@ public class PumpStateRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>UpsertAsync</c> inserts a new <see cref="PumpState"/> record when no existing entry is found for the specified <c>DeviceId</c>, and that the persisted state retains the provided property values.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=428a2bd body=4500878 -->
|
||||
[Test]
|
||||
public async Task UpsertAsync_InsertsNewWhenNotExists()
|
||||
{
|
||||
@@ -131,6 +134,7 @@ public class PumpStateRepositoryTest
|
||||
/// the updated <see cref="PumpState"/> is persisted and retrievable with the modified <c>IsInfusing</c>,
|
||||
/// <c>Status</c>, and <c>LastUpdated</c> values.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=8838ddb body=654a229 -->
|
||||
[Test]
|
||||
public async Task UpsertAsync_UpdatesExistingState()
|
||||
{
|
||||
@@ -165,6 +169,7 @@ public class PumpStateRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>GetAllAsync</c> returns a non-null collection of pump states containing at least two entries, including those associated with the seeded devices A and B.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=a469772 body=1e9a940 -->
|
||||
[Test]
|
||||
public async Task GetAllAsync_ReturnsAllStates()
|
||||
{
|
||||
@@ -190,6 +195,7 @@ public class PumpStateRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that UpsertAsync updates an existing entity instead of inserting a duplicate, ensuring the total record count remains unchanged when upserting a <see cref="PumpState"/> for an already-known device identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=0293756 body=e6aaf62 -->
|
||||
[Test]
|
||||
public async Task UpsertAsync_DoesNotCreateDuplicates()
|
||||
{
|
||||
|
||||
@@ -22,6 +22,7 @@ public class RecordingAlertArchiveRepositoryTest
|
||||
/// <summary>
|
||||
/// One-time test setup that prepares the archive collection for recording-alert integration tests by clearing it, creating a fresh instance of <see cref="RecordingAlertArchiveRepository"/>, and seeding it with two patient recording alerts (one matching the current patient with the current timestamp and one for a different patient dated ten days earlier), verifying that both records are persisted.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=8b97155 -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -69,6 +70,7 @@ public class RecordingAlertArchiveRepositoryTest
|
||||
/// Verifies that the repository's <c>DeleteBeforeDate</c> operation removes all documents dated before the specified cutoff date, leaving only documents on or after that date.
|
||||
/// Expects more than one document in the collection initially and exactly one remaining after deletion.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d3a5eeb body=b97504a -->
|
||||
[Test]
|
||||
public async Task DeleteBeforeDate()
|
||||
{
|
||||
|
||||
@@ -23,6 +23,7 @@ public class RecordingAlertRepositoryTest
|
||||
/// One-time test setup that initializes the recording alert repository with two sample patient recording alerts
|
||||
/// and ensures the underlying collection contains exactly two documents for integration test scenarios.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=9f3c759 -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -69,6 +70,7 @@ public class RecordingAlertRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's DeleteAsync method successfully removes a PatientRecordingAlert document, confirming the record exists prior to deletion and is no longer retrievable afterwards.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=fff9e82 body=bbaa167 -->
|
||||
[Test]
|
||||
public async Task DeleteAsync()
|
||||
{
|
||||
@@ -97,6 +99,7 @@ public class RecordingAlertRepositoryTest
|
||||
/// <summary>
|
||||
/// Tests that the <c>DeleteOlderDaysAsync</c> repository method removes patient recording alerts that exceed the specified age threshold and match the given recording name, while preserving alerts within the threshold.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=da9fb95 body=be75e5b -->
|
||||
[Test]
|
||||
public async Task DeleteOlderDaysAsync()
|
||||
{
|
||||
@@ -142,6 +145,7 @@ public class RecordingAlertRepositoryTest
|
||||
/// Verifies that <c>DeleteOlderNumberAsync</c> removes older records with the specified name, keeping only the most recent ones according to the provided count.
|
||||
/// Inserts two <see cref="PatientRecordingAlert"/> entries sharing the same name but different timestamps, asserts both exist, performs the deletion, and confirms that only one record remains.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=340569b body=9066da5 -->
|
||||
[Test]
|
||||
public async Task DeleteOlderNumberAsync()
|
||||
{
|
||||
@@ -180,6 +184,7 @@ public class RecordingAlertRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>DeleteByPatientId</c> removes a patient's recording alert from the repository, ensuring the alert cannot be retrieved after deletion.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=79b17ee body=abcb960 -->
|
||||
[Test]
|
||||
public async Task DeleteByPatientId()
|
||||
{
|
||||
@@ -216,6 +221,7 @@ public class RecordingAlertRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository returns a non-null result when searching for records by patient identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=3d9563b body=644ea5e -->
|
||||
[Test]
|
||||
public async Task FindByPatientIdAsync()
|
||||
{
|
||||
@@ -229,6 +235,7 @@ public class RecordingAlertRepositoryTest
|
||||
/// for a given patient and recording name, filtering out older entries based on the
|
||||
/// specified count limit, and that the returned observation matches the expected time.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=180119e body=50b755a -->
|
||||
[Test]
|
||||
public async Task FindLastObservations()
|
||||
{
|
||||
@@ -278,6 +285,7 @@ public class RecordingAlertRepositoryTest
|
||||
/// <summary>
|
||||
/// Tests the repository's ability to update the <c>patientid</c> ObjectId field across records, verifying that after the update the original patient identifier no longer returns any alerts while the new patient identifier does, and that deletion by patient ID subsequently removes the record.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=ccbfce8 body=9bdadf4 -->
|
||||
[Test]
|
||||
public async Task UpdateManyObjectId()
|
||||
{
|
||||
|
||||
@@ -21,6 +21,7 @@ public class ServiceConfigRepositoryTest
|
||||
/// <summary>
|
||||
/// Performs one-time initialization for integration tests by creating a <see cref="ServiceConfig"/> entry in the test database and preparing the repository used by the test fixture.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=0b44aa1 -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -57,6 +58,7 @@ public class ServiceConfigRepositoryTest
|
||||
/// Verifies that <see cref="_repository"/>.FindById returns a non-null entity when queried by its string identifier,
|
||||
/// and that the returned entity's <c>StrId</c> matches the supplied id.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=a6c49cf body=afa730e -->
|
||||
[Test]
|
||||
public async Task FindById_Find_string()
|
||||
{
|
||||
@@ -70,6 +72,7 @@ public class ServiceConfigRepositoryTest
|
||||
/// Verifies that the repository's FindById method successfully retrieves an object by its identifier,
|
||||
/// returning a non-null result whose Id matches the requested identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=eb5b627 body=fbdee32 -->
|
||||
[Test]
|
||||
public async Task FindById_Find_ObjectId()
|
||||
{
|
||||
|
||||
@@ -23,6 +23,7 @@ public class TreatmentArchiveRepositoryTest
|
||||
/// <summary>
|
||||
/// One-time setup method that prepares the integration test environment for the treatment archive repository by creating and inserting two sample patient treatments (one new and one discontinued) into a freshly created archive collection.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=4a90d78 -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -82,6 +83,7 @@ public class TreatmentArchiveRepositoryTest
|
||||
/// Tests the <see cref="DeleteBeforeDate"/> repository method to ensure it correctly removes records older than the specified cutoff date,
|
||||
/// leaving only the most recent record. Verifies that when multiple patient records exist, deletion by date retains exactly one record.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d3a5eeb body=7124e14 -->
|
||||
[Test]
|
||||
public async Task DeleteBeforeDate()
|
||||
{
|
||||
@@ -101,6 +103,7 @@ public class TreatmentArchiveRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository successfully retrieves a non-empty collection of records associated with the specified patient.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=8768b4a body=58e5f0b -->
|
||||
[Test]
|
||||
public async Task FindAllFromPatient()
|
||||
{
|
||||
|
||||
@@ -24,6 +24,7 @@ public class TreatmentRepositoryTest
|
||||
/// <summary>
|
||||
/// One-time test setup that resets the treatments collection, instantiates the repository, and seeds two patient treatments (one with OrderControlType.Nw and one with OrderControlType.Dc) to verify insert behavior.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=d7a95ac -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -89,6 +90,7 @@ public class TreatmentRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that GetByPatientId returns an empty result collection rather than null when no patient treatments are found for the supplied patient identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=5d6b968 body=becd285 -->
|
||||
[Test]
|
||||
public async Task GetByPatientId_Not_Find_Return_Null()
|
||||
{
|
||||
@@ -103,6 +105,7 @@ public class TreatmentRepositoryTest
|
||||
/// Tests that the repository's <c>GetByPatientId</c> method returns the expected patient treatment records
|
||||
/// for the given patient, verifying that the result is not null and contains the expected number of entries.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=522d60f body=0afdfdf -->
|
||||
[Test]
|
||||
public async Task GetByPatientId_Find_Return_Null()
|
||||
{
|
||||
@@ -117,6 +120,7 @@ public class TreatmentRepositoryTest
|
||||
/// Verifies that <see cref="DeleteAsync"/> successfully removes a persisted patient treatment from the repository.
|
||||
/// The test inserts a treatment, confirms it exists, deletes it by id, and asserts it is no longer retrievable.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=fff9e82 body=fe6c727 -->
|
||||
[Test]
|
||||
public async Task DeleteAsync()
|
||||
{
|
||||
@@ -151,6 +155,7 @@ public class TreatmentRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>FindByPatientIdAsync</c> returns a non-null list containing the expected number of treatments for the specified patient.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=bf1a413 body=cdada4a -->
|
||||
[Test]
|
||||
public async Task FindByPatientIdAsync_Find_Return_List_Traetments()
|
||||
{
|
||||
@@ -163,6 +168,7 @@ public class TreatmentRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that <see cref="DeleteByPatientId"/> removes the patient treatment associated with the given patient identifier, ensuring no records remain for that patient after deletion.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=79b17ee body=fadf697 -->
|
||||
[Test]
|
||||
public async Task DeleteByPatientId()
|
||||
{
|
||||
@@ -197,6 +203,7 @@ public class TreatmentRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that _repository.FindBolusTreatments returns a non-null collection containing exactly one bolus treatment for the specified patient.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=dfa52bd body=9cc200d -->
|
||||
[Test]
|
||||
public async Task FindBolusTreatments_Find_Return_Treatment()
|
||||
{
|
||||
@@ -209,6 +216,7 @@ public class TreatmentRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that FindByPatientIdAsync returns a non-null list containing the expected number of treatments for the specified patient.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=843efa7 body=cdada4a -->
|
||||
[Test]
|
||||
public async Task FindByPatientId_Find_Return_List_Traetments()
|
||||
{
|
||||
|
||||
@@ -22,6 +22,7 @@ public class UnitRepositoryTest
|
||||
/// <summary>
|
||||
/// One-time setup method that prepares the integration test environment by configuring API settings, creating a fresh "units" collection in the database, and seeding it with two sample <see cref="Unit"/> records via the <see cref="UnitRepository"/>.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=a56e489 -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -65,6 +66,7 @@ public class UnitRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that inserting a valid <see cref="Unit"/> into the repository returns the unit and that the inserted unit can be successfully retrieved by its identifier, with key properties preserved.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=9b26826 body=ddc8404 -->
|
||||
[Test]
|
||||
public async Task InsertOneUnit_ValidUnit_ReturnsUnit()
|
||||
{
|
||||
@@ -132,6 +134,7 @@ public class UnitRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that FindById retrieves the matching <see cref="Unit"/> from the repository when a valid identifier is provided.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=502c001 body=dc7d781 -->
|
||||
[Test]
|
||||
public async Task FindById_ValidId_ReturnsUnit()
|
||||
{
|
||||
@@ -157,6 +160,7 @@ public class UnitRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that FindById returns <c>null</c> when queried with an ID that does not exist in the repository.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=eeda1b7 body=fa50971 -->
|
||||
[Test]
|
||||
public async Task FindById_InvalidId_ReturnsNull()
|
||||
{
|
||||
@@ -214,6 +218,7 @@ public class UnitRepositoryTest
|
||||
/// Verifies that the repository's <c>FindByName</c> method returns the matching unit when called with a valid unit name.
|
||||
/// The test inserts a unit, retrieves it by name, and asserts that the returned entity is not null and has the expected name.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=1b153db body=e466985 -->
|
||||
[Test]
|
||||
public async Task FindByName_ValidName_ReturnsUnit()
|
||||
{
|
||||
@@ -239,6 +244,7 @@ public class UnitRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the repository's FindByName method returns null when invoked with a name that does not match any existing entity.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=bca62d2 body=2ab2e2d -->
|
||||
[Test]
|
||||
public async Task FindByName_InvalidName_ReturnsNull()
|
||||
{
|
||||
@@ -353,6 +359,7 @@ public class UnitRepositoryTest
|
||||
/// Verifies that <c>GetAll</c> returns a non-null collection containing the units that have been inserted into the repository.
|
||||
/// </summary>
|
||||
/// <exception cref="ArgumentNullException">Thrown when the <c>units</c> collection used to seed the repository is <c>null</c>.</exception>
|
||||
/// <!-- aidoc:v1 sig=5b909a9 body=2d25d8f -->
|
||||
[Test]
|
||||
public async Task GetAll_ReturnsAllUnits()
|
||||
{
|
||||
@@ -381,6 +388,7 @@ public class UnitRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that UpdateUnit correctly updates an existing unit in the repository and returns the updated entity with the new title and the original identifier.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=0c12e38 body=287b440 -->
|
||||
[Test]
|
||||
public async Task UpdateUnit_ValidUnit_ReturnsUpdatedUnit()
|
||||
{
|
||||
|
||||
@@ -18,6 +18,7 @@ public class UserRepositoryTest
|
||||
/// <summary>
|
||||
/// One-time integration test setup that prepares a clean "users" collection in the test database and seeds it with two predefined users, ensuring a deterministic state for downstream test cases.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=4cb16c2 -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -61,6 +62,7 @@ public class UserRepositoryTest
|
||||
/// <summary>
|
||||
/// Verifies that the <see cref="_repository"/>'s <c>GetUser</c> method asynchronously returns a non-null user with the expected username and password credentials.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=04ad7c8 body=29ee994 -->
|
||||
[Test]
|
||||
public async Task GetUser()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user