The configured setup will be applied to invocations exactly n-times. After that it will be ignored.

Hierarchy

  • PlayableExactly

Implements

Constructors

Methods

Constructors

Methods

  • Invokes as the setup is about to be played, so the playable logic can change it's state.

    Example


    const playable1 = new PlayableOnce();
    const playable2 = new PlayableOnce();

    const mock = new Mock<(val: number) => void)>()
    // setup A
    .setup(instance => instance(1))
    .play(playable1)
    .returns(1)
    // setup B
    .setup(instance => instance(2))
    .play(playable2)
    .returns(2);

    const actual = mock.object()(1);
    // at this point the update of playable1 should be called with OwnSetupWouldBePlayed
    // because setup A would be played
    // and the update of playable2 should be called with OtherSetupWouldBePlayed

    Parameters

    Returns void

Generated using TypeDoc