Go to repository

Class JoinedExpectation

A joined expectation consist of multiple expectations joined by a specific joiner function. A JoinedExpectation implements AbstractFinishedExpectation, where the result is calculated using the given joiner function.

Currently two join forms are provided, expect!and, and expect!or.

Hierarchy (view full)

Constructors

Create a new instance of a JoinedExpectation for the given set of expectations, using the provided joiner.

Parameters

Returns JoinedExpectation

Properties

Private
result: boolean

The result of a joined expectation, set at construction time.

Methods

If the result of the expectation is true, run the given function.

Parameters

  • action: (() => void)
      • (): void
      • Returns void

Returns void

If the result of the expectation is true, run the first of the functions, if false, run the second one.

Parameters

  • actionWhenTrue: (() => void)
      • (): void
      • Returns void

  • actionWhenFalse: (() => void)
      • (): void
      • Returns void

Returns void

Return's the result of the expectancy as a boolean.

Returns boolean

true if the value satisfied the expectation, falseotherwise.

If the result of the expectation is false, run the given function.

Parameters

  • action: (() => void)
      • (): void
      • Returns void

Returns void

If the result of the expectation is false, throw the given error.

Parameters

Returns void

If the result of the expectation is false, return the given value.

Type Parameters

  • T

Parameters

  • value: T

Returns T