# Class AlarmRepositoryTest

Namespace
  adas_core.Test.Repositories

Assembly
  adas-core.Test.dll

    [TestFixture]
    [Order(1)]
    [Category("Integration")]
    public class AlarmRepositoryTest

Inheritance
  object
  AlarmRepositoryTest

Inherited Members
  object.Equals(object)
  object.Equals(object, object)
  object.GetHashCode()
  object.GetType()
  object.MemberwiseClone()
  object.ReferenceEquals(object, object)
  object.ToString()

Extension Methods
  NumberUtils.IsNumber(object)
  NumberUtils.ToDouble(object)
  ObjectUtils.ToStr(object?)

## Methods

### AggregatedPatientLastObservationsByField_AllExpired_Returns_Empty_List()

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.

    [Test]
    public Task AggregatedPatientLastObservationsByField_AllExpired_Returns_Empty_List()

#### Returns

Task

### AggregatedPatientLastObservationsByField_FilterObservations_Null_Returns_All()

Verifies that AggregatedPatientLastObservationsByField(ObjectId, List<Field>?) returns all of a patient's last observations when no field filter is provided.

    [Test]
    public Task AggregatedPatientLastObservationsByField_FilterObservations_Null_Returns_All()

#### Returns

Task

### AggregatedPatientLastObservationsByField_Found_Returns_1()

Verifies that AggregatedPatientLastObservationsByField returns exactly one aggregated result when matching last observations are found for the specified patient and field filter.

    [Test]
    public Task AggregatedPatientLastObservationsByField_Found_Returns_1()

#### Returns

Task

### AggregatedPatientLastObservationsByField_Found_Returns_2()

Verifies that AggregatedPatientLastObservationsByField(ObjectId, List<Field>?) returns a non-null collection containing an entry for each matching field in the filter when observations are found for the given patient.

    [Test]
    public Task AggregatedPatientLastObservationsByField_Found_Returns_2()

#### Returns

Task

### AggregatedPatientLastObservationsByField_MultipleObservations_Returns_Most_Recent()

Verifies that when multiple observations exist for the same field, the aggregation returns only the most recent observation based on the timestamp.

    [Test]
    public Task AggregatedPatientLastObservationsByField_MultipleObservations_Returns_Most_Recent()

#### Returns

Task

### AggregatedPatientLastObservationsByField_Not_Found_Returns_Empty_List()

Verifies that AggregatedPatientLastObservationsByField(ObjectId, List<Field>?) returns an empty list when no observations match the provided field filter criteria.

    [Test]
    public Task AggregatedPatientLastObservationsByField_Not_Found_Returns_Empty_List()

#### Returns

Task

  A task that completes after asserting the repository returns a non-null but empty result.

### Init()

One-time test setup that initializes the alarm repository with two sample PatientObservationAlarm records by resetting the target collection and inserting the test data for use across the test fixture.

    [OneTimeSetUp]
    public Task Init()

#### Returns

Task