Header menu logo testify

AssertExpectation<'T> Type

Describes how one quoted value should be validated, rendered, and explained when it fails.

An AssertExpectation is reusable. Build it once, then pass it to Assert.result, Assert.should, or the Assert operator DSL.

In the DSL, expectations are usually applied with |>?, composed with <|> and <&>, or used in readable multi-expectation lists with ||? and &&?.

Record fields

Record Field Description

Because

Full Usage: Because

Field type: Observed<'T> -> string option

Optionally explains why the expectation failed.

Field type: Observed<'T> -> string option

Description

Full Usage: Description

Field type: string

A human-readable description of the expected behavior.

Field type: string

Details

Full Usage: Details

Field type: Observed<'T> -> FailureDetails option

Optionally provides structured nested details for rich rendering.

Field type: Observed<'T> -> FailureDetails option

Format

Full Usage: Format

Field type: Observed<'T> -> string

Formats the observed result for display in reports.

Field type: Observed<'T> -> string

Label

Full Usage: Label

Field type: string

A short stable label used in reports and structured failure details.

Field type: string

Verify

Full Usage: Verify

Field type: Observed<'T> -> bool

Determines whether the observed result satisfies the expectation.

Field type: Observed<'T> -> bool

Static members

Static member Description

AssertExpectation.AndAlso(a, b)

Full Usage: AssertExpectation.AndAlso(a, b)

Parameters:
Returns: AssertExpectation<'T> An expectation that succeeds only when both input expectations succeed.

Combines two expectations so that both must succeed.

a : AssertExpectation<'T>

The first required expectation.

b : AssertExpectation<'T>

The second required expectation.

Returns: AssertExpectation<'T>

An expectation that succeeds only when both input expectations succeed.

AssertExpectation.OrElse(a, b)

Full Usage: AssertExpectation.OrElse(a, b)

Parameters:
Returns: AssertExpectation<'T> An expectation that succeeds when either input expectation succeeds.

Combines two expectations so that either one may succeed.

a : AssertExpectation<'T>

The first alternative expectation.

b : AssertExpectation<'T>

The second alternative expectation.

Returns: AssertExpectation<'T>

An expectation that succeeds when either input expectation succeeds.

Type something to start searching.