# Class PointOfCareRepositoryTests

Namespace
  adas_core.Test.Repositories

Assembly
  adas-core.Test.dll

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

Inheritance
  object
  PointOfCareRepositoryTests

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

### Delete_ValidId_DeletesSuccessfully()

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.

    [Test]
    public Task Delete_ValidId_DeletesSuccessfully()

#### Returns

Task

### FindByBed_ValidBed_ReturnsMatchingPointOfCares()

Verifies that the repository returns the matching PointOfCare when queried with a valid bed identifier.

    [Test]
    public Task FindByBed_ValidBed_ReturnsMatchingPointOfCares()

#### Returns

Task

### FindById_ExistingId_ReturnsPointOfCare()

Verifies that the repository's `FindById` method returns the correct `PointOfCare` document when queried with an existing identifier, by inserting a document and asserting that the retrieved entity matches the expected one.

    [Test]
    public Task FindById_ExistingId_ReturnsPointOfCare()

#### Returns

Task

### FindByRoom_ValidRoom_ReturnsMatchingPointOfCares()

Tests that `FindByRoom` returns the matching `PointOfCare` when a valid room is provided. Inserts a valid `PointOfCare` 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 `PointOfCare` has a non-null `Unit`.

    [Test]
    public Task FindByRoom_ValidRoom_ReturnsMatchingPointOfCares()

#### Returns

Task

### FindByUnitAndStatus_ExistingUnitAndStatus_ReturnsMatchingPointOfCares()

Verifies that FindByUnitAndStatus returns the matching `PointOfCare` documents when queried with an existing unit identifier and status.

    [Test]
    public Task FindByUnitAndStatus_ExistingUnitAndStatus_ReturnsMatchingPointOfCares()

#### Returns

Task

### GetAll_ReturnsAllPointOfCares()

Verifies that the `GetAll` repository method returns all stored `PointOfCare` entries, including a newly inserted one identified by its assigned Id.

    [Test]
    public Task GetAll_ReturnsAllPointOfCares()

#### Returns

Task

### Init()

Performs one-time setup for integration tests by initializing mock dependencies and resetting the "pointOfCares" MongoDB collection before instantiating the PointOfCareRepository.

    [OneTimeSetUp]
    public Task Init()

#### Returns

Task

### InsertOneAsync_ValidPointOfCare_InsertsSuccessfully()

Verifies that InsertOneAsync successfully inserts a valid point of care into the repository and that the record can be retrieved by its identifier.

    [Test]
    public Task InsertOneAsync_ValidPointOfCare_InsertsSuccessfully()

#### Returns

Task

### Update_ValidPointOfCare_UpdatesSuccessfully()

Verifies that PointOfCare entities can be updated successfully when valid data is provided, ensuring that modified properties such as `Room` and `Bed` are persisted and retrievable after the update operation.

    [Test]
    public Task Update_ValidPointOfCare_UpdatesSuccessfully()

#### Returns

Task