StatefulAssertion
Hierarchy
Assertion
↳ StatefulAssertion
Index
Constructors
Properties
Methods
Constructors
constructor
+ new StatefulAssertion(asserter: Asserter): StatefulAssertion
Inherited from Assertion.constructor
Overrides void
Parameters:
| Name | Type | 
|---|---|
asserter | Asserter | 
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], ])
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:
| Name | Type | Description | 
|---|---|---|
expectedStates | State[] | Expected list of states 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.
ensureIsInState
▸ ensureIsInState(expectedState: State, error?: DomainError): Asserter
Ensures that Entity is expected state.
Parameters:
| Name | Type | Description | 
|---|---|---|
expectedState | State | Expected state that Entity should be in. | 
error? | DomainError | Optional 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:
| Name | Type | Description | 
|---|---|---|
expectedStates | State[] | Expected list of states 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.
ensureIsNotInState
▸ ensureIsNotInState(expectedState: State, error?: DomainError): Asserter
Ensures that Entity is NOT in expected state.
Parameters:
| Name | Type | Description | 
|---|---|---|
expectedState | State | Expected state 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›