Skip to content

TestModel <TSnapshot, TEvent, TInput>

Creates a test model that represents an abstract model of a system under test (SUT).

The test model is used to generate test paths, which are used to verify that states in the model are reachable in the SUT.

Index

Constructors

constructor

  • new TestModel<TSnapshot, TEvent, TInput>(logic: ActorLogic<TSnapshot, TEvent, TInput, AnyActorSystem>, options?: Partial<TestModelOptions<TSnapshot, TEvent>>): TestModel<TSnapshot, TEvent, TInput>

Properties

publicoptionaldefaultTraversalOptions

defaultTraversalOptions?: TraversalOptions<TSnapshot, TEvent>

publiclogic

logic: ActorLogic<TSnapshot, TEvent, TInput, AnyActorSystem>

publicoptions

options: TestModelOptions<TSnapshot, TEvent>

Methods

publicgetAdjacencyList

  • getAdjacencyList(): { event: TEvent; nextState: TSnapshot; state: TSnapshot }[]
  • An array of adjacencies, which are objects that represent each state with the nextState given the event.


    Returns { event: TEvent; nextState: TSnapshot; state: TSnapshot }[]

publicgetAllStates

  • getAllStates(): TSnapshot[]
  • Returns TSnapshot[]

publicgetDefaultOptions

publicgetPaths

publicgetPathsFromEvents

publicgetShortestPaths

publicgetShortestPathsFrom

publicgetSimplePaths

publicgetSimplePathsFrom

publicresolveOptions

publictestPath

publictestPathSync

publictestState

  • testState(params: TestParam<TSnapshot, TEvent>, state: TSnapshot, options?: Partial<TestModelOptions<TSnapshot, TEvent>>): Promise<void>
  • Parameters

    Returns Promise<void>

publictestStateSync

  • testStateSync(params: TestParam<TSnapshot, TEvent>, state: TSnapshot, options?: Partial<TestModelOptions<TSnapshot, TEvent>>): void
  • Parameters

    Returns void

publictestTransition

  • testTransition(params: TestParam<TSnapshot, TEvent>, step: Step<TSnapshot, TEvent>): Promise<void>
  • Parameters

    • params: TestParam<TSnapshot, TEvent>
    • step: Step<TSnapshot, TEvent>

    Returns Promise<void>

publictestTransitionSync

  • testTransitionSync(params: TestParam<TSnapshot, TEvent>, step: Step<TSnapshot, TEvent>): void
  • Parameters

    • params: TestParam<TSnapshot, TEvent>
    • step: Step<TSnapshot, TEvent>

    Returns void