# Class RecordingAlertRepositoryTest

Namespace
  adas_core.Test.Repositories

Assembly
  adas-core.Test.dll

    [TestFixture]
    [Category("Integration")]
    public class RecordingAlertRepositoryTest

Inheritance
  object
  RecordingAlertRepositoryTest

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

### DeleteAsync()

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.

    [Test]
    public Task DeleteAsync()

#### Returns

Task

### DeleteByPatientId()

Verifies that `DeleteByPatientId` removes a patient's recording alert from the repository, ensuring the alert cannot be retrieved after deletion.

    [Test]
    public Task DeleteByPatientId()

#### Returns

Task

### DeleteOlderDaysAsync()

Tests that the `DeleteOlderDaysAsync` repository method removes patient recording alerts that exceed the specified age threshold and match the given recording name, while preserving alerts within the threshold.

    [Test]
    public Task DeleteOlderDaysAsync()

#### Returns

Task

### DeleteOlderNumberAsync()

Verifies that `DeleteOlderNumberAsync` removes older records with the specified name, keeping only the most recent ones according to the provided count. Inserts two PatientRecordingAlert entries sharing the same name but different timestamps, asserts both exist, performs the deletion, and confirms that only one record remains.

    [Test]
    public Task DeleteOlderNumberAsync()

#### Returns

Task

### FindByPatientIdAsync()

Verifies that the repository returns a non-null result when searching for records by patient identifier.

    [Test]
    public Task FindByPatientIdAsync()

#### Returns

Task

### FindLastObservations()

Verifies that `FindLastObservations` returns only the most recent recording alert 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.

    [Test]
    public Task FindLastObservations()

#### Returns

Task

### Init()

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.

    [OneTimeSetUp]
    public Task Init()

#### Returns

Task

### UpdateManyObjectId()

Tests the repository's ability to update the `patientid` 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.

    [Test]
    public Task UpdateManyObjectId()

#### Returns

Task