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

This commit is contained in:
julian
2026-06-28 02:50:05 -07:00
parent a19fb90902
commit 586f02a2ca
654 changed files with 5260 additions and 0 deletions
@@ -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()
{