Table of Contents

Class TestUtilities

Namespace
adas_core.Test.Utilities
Assembly
adas-core.Test.dll

Provides a collection of utility members to support testing operations and helper functionality.

public class TestUtilities
Inheritance
TestUtilities
Inherited Members
Extension Methods

Methods

CreateValidAdmission()

Creates and returns a valid Admission instance populated with sample test data, including generated unique identifiers, a test person, option lists for origin, diagnosis, insulation, language barrier, allergies, and a patient location.

public static Admission CreateValidAdmission()

Returns

Admission

A new Admission object fully initialized with valid test values.

CreateValidCardConfig(ObjectId?)

Creates a valid CardConfig instance with a default structure consisting of a single row containing one DemographicCell wrapped in a CellWrapper with a grow priority of 1.

public static CardConfig CreateValidCardConfig(ObjectId? id = null)

Parameters

id ObjectId?

The optional identifier for the configuration. If null, a new MongoDB.Bson.ObjectId is generated.

Returns

CardConfig

A newly created CardConfig populated with the default valid configuration.

CreateValidCardDetailsNurseConfig(ObjectId?)

Creates a valid CardDetailsConfig instance configured for the nurse display, including a demographic row containing allergy and demographic cells. If no identifier is supplied, a new MongoDB.Bson.ObjectId is generated.

public static CardDetailsConfig CreateValidCardDetailsNurseConfig(ObjectId? id = null)

Parameters

id ObjectId?

The optional identifier to assign to the configuration. When null, a new MongoDB.Bson.ObjectId is generated.

Returns

CardDetailsConfig

A CardDetailsConfig populated with the nurse display configuration.

CreateValidCardDetailsSmartConfig(ObjectId?)

Creates a valid CardDetailsConfig instance populated with a default smart section layout, including a general row that contains beacon color and isolation observations. If no identifier is supplied, a new MongoDB.Bson.ObjectId is generated for the configuration.

public static CardDetailsConfig CreateValidCardDetailsSmartConfig(ObjectId? id = null)

Parameters

id ObjectId?

The optional identifier to assign to the configuration. When null, a new MongoDB.Bson.ObjectId is generated.

Returns

CardDetailsConfig

A CardDetailsConfig configured with a predefined smart section layout.

CreateValidDischarge()

Creates a valid Discharge instance populated with generated identifiers, current UTC timestamps, and default test values for use in test scenarios.

public static Discharge CreateValidDischarge()

Returns

Discharge

A fully populated Discharge object with all required fields set to valid values.

CreateValidDisplayConfig(DisplayType, ObjectId?, ObjectId?, ObjectId?)

Creates a valid DisplayConfig instance, generating new MongoDB.Bson.ObjectId values for any ID parameters that are null. Intended for use in test scenarios.

public static DisplayConfig CreateValidDisplayConfig(DisplayConfigEnums.DisplayType type, ObjectId? id, ObjectId? idCard, ObjectId? idDetail)

Parameters

type DisplayConfigEnums.DisplayType

The display type to assign to the configuration.

id ObjectId?

The optional identifier for the display config. A new MongoDB.Bson.ObjectId is generated when null.

idCard ObjectId?

The optional card config identifier. A new MongoDB.Bson.ObjectId is generated when null.

idDetail ObjectId?

The optional detail config identifier. A new MongoDB.Bson.ObjectId is generated when null.

Returns

DisplayConfig

A fully populated DisplayConfig with default field and hospital values.

CreateValidOptionList()

Creates a new OptionList instance populated with predefined valid test values, typically used as a helper for unit tests or test data seeding.

public static OptionList CreateValidOptionList()

Returns

OptionList

An OptionList with sample values, where InitDate is set to the current UTC time and EndDate is set to one day after the current UTC time.

CreateValidPatient()

Creates and returns a new Patient instance populated with valid test/default values, including a generated identifier, sample patient numbers, admission timestamp, and related option list entries for discharge status, altable, and origin.

public static Patient CreateValidPatient()

Returns

Patient

A fully initialized Patient object suitable for use in testing or seeding scenarios.

CreateValidPointOfCare()

Creates and returns a fully populated, valid PointOfCare instance with predefined test values, typically used as a helper for unit testing or seeding sample data.

public static PointOfCare CreateValidPointOfCare()

Returns

PointOfCare

A new PointOfCare object initialized with valid identifiers, room and bed information, an available status, a default configuration, and a referenced unit.

CreateValidUnit()

Creates a new Unit instance populated with valid default values, typically used for testing or seeding purposes.

public static Unit CreateValidUnit()

Returns

Unit

A new Unit object with a generated unique identifier, default title and name, no last update timestamp, an empty list of point of care IDs, an OK status, and a configuration with auto ADT enabled.