Skip to content

TimeSpanAssertions.BeApproximately Method ​

Definition ​

Asserts that the TimeSpan value is approximately equal to the expected value within the specified precision.

c#
public AssertionsChain<TimeSpanAssertions, TimeSpan> BeApproximately(TimeSpan expected, TimeSpan precision);

View source

Parameters ​

NameTypeDescription
expectedTimeSpanThe expected value.
precisionTimeSpanThe maximum allowed difference between the value and the expected value.

Returns ​

AssertionsChain<TimeSpanAssertions, TimeSpan>

An AssertionsChain<TAssertions, T> for chaining further assertions.