StatefulAssertion

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

+ new StatefulAssertion(asserter: Asserter): StatefulAssertion

Inherited from Assertion.constructor

Overrides void

Parameters:

NameType
asserterAsserter

Returns: StatefulAssertion

Properties

api

• api: Map‹string, Function› = new Map([ ['ensure.is.inState', this.ensureIsInState as Function], ['ensure.is.not.inState', this.ensureIsNotInState as Function], ['ensure.is.inOneOfStates', this.ensureIsInOneOfStates as Function], ['ensure.is.not.inOneOfStates', this.ensureIsNotInOneOfStates as Function], ])

Overrides Assertion.api


asserter

• asserter: Asserter

Inherited from Assertion.asserter

Overrides void

Methods

ensureIsInOneOfStates

▸ ensureIsInOneOfStates(expectedStates: State[], error?: DomainError): Asserter

Ensures that Entity is one of expected states.

Parameters:

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

Returns: Asserter

Asserter implementation instance.


ensureIsInState

▸ ensureIsInState(expectedState: State, error?: DomainError): Asserter

Ensures that Entity is expected state.

Parameters:

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

Returns: Asserter

Asserter implementation instance.


ensureIsNotInOneOfStates

▸ ensureIsNotInOneOfStates(expectedStates: State[], error?: DomainError): Asserter

Ensures that Entity is NOT in one of expected states.

Parameters:

NameTypeDescription
expectedStatesState[]Expected list of states 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.


ensureIsNotInState

▸ ensureIsNotInState(expectedState: State, error?: DomainError): Asserter

Ensures that Entity is NOT in expected state.

Parameters:

NameTypeDescription
expectedStateStateExpected state 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›