Class PumpAlarmStateRepositoryTest
- Namespace
- adas_core.Test.Repositories
- Assembly
- adas-core.Test.dll
[TestFixture]
[Category("Integration")]
public class PumpAlarmStateRepositoryTest
- Inheritance
-
PumpAlarmStateRepositoryTest
- Inherited Members
- Extension Methods
Methods
DeleteByPatientId_Works()
Verifies that the repository's DeleteByPatientId method successfully removes a previously upserted
PumpAlarmState for the specified patient, ensuring no matching records remain in the collection.
[Test]
public Task DeleteByPatientId_Works()
Returns
FindActiveAsync_ReturnsCorrectAlarm()
Verifies that FindActiveAsync returns the correct active alarm matching the specified device identifier, alarm type, and alarm code.
[Test]
public Task FindActiveAsync_ReturnsCorrectAlarm()
Returns
FindActiveAsync_ReturnsNull_WhenNotFound()
Verifies that FindActiveAsync returns null when no active alarm matching the specified device, alarm type, and identifier exists.
[Test]
public Task FindActiveAsync_ReturnsNull_WhenNotFound()
Returns
FindAllActiveByDeviceAsync_ReturnsCorrect()
Verifies that FindAllActiveByDeviceAsync returns only active pump alarm states that belong to the specified device.
[Test]
public Task FindAllActiveByDeviceAsync_ReturnsCorrect()
Returns
Init()
One-time setup that prepares the integration test environment for 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.
[OneTimeSetUp]
public Task Init()
Returns
RemoveAsync_RemovesAllMatching()
Verifies that RemoveAsync removes every active alarm matching the specified device identifier and alarm type, not just a single record.
[Test]
public Task RemoveAsync_RemovesAllMatching()
Returns
RemoveAsync_Works()
Verifies that RemoveAsync correctly deletes an active alarm by device, alarm type, and alarm code, and that a subsequent lookup returns no result.
[Test]
public Task RemoveAsync_Works()
Returns
UpdateManyObjectIdByFieldNameAsync_Works()
Verifies that UpdateManyObjectIdByFieldNameAsync successfully updates the PatientId field
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.
[Test]
public Task UpdateManyObjectIdByFieldNameAsync_Works()
Returns
UpsertActiveAsync_InsertsNew()
Verifies that UpsertActiveAsync correctly inserts a new active pump alarm into the repository
when no existing alarm with the same device, type, and code is found, and that the inserted alarm
can subsequently be retrieved via FindActiveAsync.
[Test]
public Task UpsertActiveAsync_InsertsNew()
Returns
UpsertActiveAsync_InsertsWhenAlarmCodeIsNull()
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.
[Test]
public Task UpsertActiveAsync_InsertsWhenAlarmCodeIsNull()
Returns
UpsertActiveAsync_NoDuplicateOnRepeatedCalls()
[Test]
public Task UpsertActiveAsync_NoDuplicateOnRepeatedCalls()
Returns
UpsertActiveAsync_UpdatesExisting()
[Test]
public Task UpsertActiveAsync_UpdatesExisting()