StatusfulAssertion
Hierarchy
Assertion
↳ StatusfulAssertion
Index
Constructors
Properties
Methods
Constructors
constructor
+ new StatusfulAssertion(asserter
: Asserter): StatusfulAssertion
Inherited from Assertion.constructor
Overrides void
Parameters:
Name | Type |
---|---|
asserter | Asserter |
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, ], ])
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:
Name | Type | Description |
---|---|---|
expectedStatuses | Status[] | Expected list of statuses in one of which Entity should be. |
error? | DomainError | Optional 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:
Name | Type | Description |
---|---|---|
expectedStatus | Status | Expected status that Entity should be in. |
error? | DomainError | Optional 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:
Name | Type | Description |
---|---|---|
expectedStatuses | Status[] | Expected list of statuses in one of which Entity shouldn't be. |
error? | DomainError | Optional 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:
Name | Type | Description |
---|---|---|
expectedStatus | Status | Expected status that Entity shouldn't be in. |
error? | DomainError | Optional 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›