# Class DisplayServiceTest

Namespace
  adas_core.Test.Services

Assembly
  adas-core.Test.dll

    [TestFixture]
    public class DisplayServiceTest

Inheritance
  object
  DisplayServiceTest

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

### GetAllByUser_ShouldReturnDisplays_WhenAdmin()

    [Test]
    public Task GetAllByUser_ShouldReturnDisplays_WhenAdmin()

#### Returns

Task

### GetAllByUser_ShouldReturnEmpty_WhenUserNameNull()

Verifies that _displayService.GetAllByUser returns an empty collection when the user name is null.

    [Test]
    public Task GetAllByUser_ShouldReturnEmpty_WhenUserNameNull()

#### Returns

Task

### GetByConfigId_ShouldReturnDisplays()

Verifies that GetByConfigId(ObjectId) returns the displays associated with the specified configuration ID retrieved from the repository.

    [Test]
    public Task GetByConfigId_ShouldReturnDisplays()

#### Returns

Task

  A task that completes when the assertion confirms the returned collection contains the expected number of displays.

### GetById_ShouldReturnDisplay()

Verifies that the DisplayService returns the expected Display instance when a matching id is provided through the repository.

    [Test]
    public Task GetById_ShouldReturnDisplay()

#### Returns

Task

### GetByName_ShouldThrow_WhenNotFound()

Verifies that the GetByName(string) method throws a NotFoundException when no display matching the specified name is found in the repository.

    [Test]
    public void GetByName_ShouldThrow_WhenNotFound()

### GetByPointOfCare_ShouldReturnDisplays()

Tests that GetByPointOfCare returns the displays associated with the specified point of care.

    [Test]
    public Task GetByPointOfCare_ShouldReturnDisplays()

#### Returns

Task

  A task representing the asynchronous test execution.

### GetByType_ShouldReturnDisplays()

Verifies that retrieving display configurations by type returns the associated displays from the display repository, ensuring the service correctly resolves configurations and their linked displays for the given display type.

    [Test]
    public Task GetByType_ShouldReturnDisplays()

#### Returns

Task

### GetByType_ShouldReturnEmpty_WhenNoConfigsFound()

Verifies that GetByType(DisplayType) returns an empty collection when no display configurations are found for the specified display type.

    [Test]
    public Task GetByType_ShouldReturnEmpty_WhenNoConfigsFound()

#### Returns

Task

  A task that completes when the assertion confirming the empty result has been executed.

### GetByUnitId_ShouldReturnDisplays()

Verifies that GetByUnitId(ObjectId) returns the displays associated with the specified unit identifier when the repository contains matching records.

    [Test]
    public Task GetByUnitId_ShouldReturnDisplays()

#### Returns

Task

### GetInfo_ShouldReturnDisplayWithPoc()

Verifies that `GetInfo` returns a Display with its associated `PointOfCare` entries populated when invoked with the "with POC" flag enabled and a valid display identifier.

    [Test]
    public Task GetInfo_ShouldReturnDisplayWithPoc()

#### Returns

Task

### InsertOne_ShouldInsertDisplay()

Verifies that InsertOne(Display) inserts a display by resolving the default configuration for its type and persisting it through the repository's insert method.

    [Test]
    public Task InsertOne_ShouldInsertDisplay()

#### Returns

Task

### SetUp()

Initializes mocked dependencies and configuration required to construct a DisplayService instance for unit tests. Sets up the HTTP context with a test user claim, creates default cache settings, and wires all collaborators (repositories, services, logger, permissions) into the service under test.

    [SetUp]
    public void SetUp()

### UpdateConfigPreset_ShouldThrow_WhenUpdateFails()

Verifies that UpdateConfigPreset(ObjectId, ObjectId) throws a NotFoundException when the repository update operation returns a null result, indicating the display or configuration preset could not be found.

    [Test]
    public void UpdateConfigPreset_ShouldThrow_WhenUpdateFails()

### UpdatePointOfCareList_ShouldThrow_WhenDisplayNotFound()

Verifies that UpdatePointOfCareList throws a NotFoundException when the display with the specified identifier does not exist.

    [Test]
    public void UpdatePointOfCareList_ShouldThrow_WhenDisplayNotFound()

#### Exceptions

NotFoundException

  Thrown when no display is found for the given id.