StatusfulAssertion

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

+ new StatusfulAssertion(asserter: Asserter): StatusfulAssertion

Inherited from Assertion.constructor

Overrides void

Parameters:

NameType
asserterAsserter

Returns: StatusfulAssertion

Properties

api

api: Map‹string, Function› = new Map([ ['ensure.is.inStatus', this.ensureIsInStatus as Function], ['ensure.is.not.inStatus', this.ensureIsNotInStatus as Function], ['ensure.is.inOneOfStatuses', this.ensureIsInOneOfStatuses as Function], [ 'ensure.is.not.inOneOfStatuses', this.ensureIsNotInOneOfStatuses as Function, ], ])

Overrides Assertion.api


asserter

asserter: Asserter

Inherited from Assertion.asserter

Overrides void

Methods

ensureIsInOneOfStatuses

ensureIsInOneOfStatuses(expectedStatuses: Status[], error?: DomainError): Asserter

Ensures that Entity is one of expected statuses.

Parameters:

NameTypeDescription
expectedStatusesStatus[]Expected list of statuses in one of which Entity should be.
error?DomainErrorOptional instance of DomainError that will be thrown upon failed assertion.

Returns: Asserter

Asserter implementation instance.


ensureIsInStatus

ensureIsInStatus(expectedStatus: Status, error?: DomainError): Asserter

Ensures that Entity is expected status.

Parameters:

NameTypeDescription
expectedStatusStatusExpected status that Entity should be in.
error?DomainErrorOptional instance of DomainError that will be thrown upon failed assertion.

Returns: Asserter

Asserter implementation instance.


ensureIsNotInOneOfStatuses

ensureIsNotInOneOfStatuses(expectedStatuses: Status[], error?: DomainError): Asserter

Ensures that Entity is NOT in one of expected statuses.

Parameters:

NameTypeDescription
expectedStatusesStatus[]Expected list of statuses in one of which Entity shouldn't be.
error?DomainErrorOptional instance of DomainError that will be thrown upon failed assertion.

Returns: Asserter

Asserter implementation instance.


ensureIsNotInStatus

ensureIsNotInStatus(expectedStatus: Status, error?: DomainError): Asserter

Ensures that Entity is NOT in expected status.

Parameters:

NameTypeDescription
expectedStatusStatusExpected status that Entity shouldn't be in.
error?DomainErrorOptional instance of DomainError that will be thrown upon failed assertion.

Returns: Asserter

Asserter implementation instance.


getApi

getApi(): Map‹string, Function›

Inherited from Assertion.getApi

Overrides void

Returns: Map‹string, Function›