Skip to content

DateTimeOffsetAssertions.BeApproximately Method ​

Definition ​

Asserts that the DateTimeOffset value is within the specified precision of the expected value.

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

View source

Parameters ​

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

Returns ​

AssertionsChain<DateTimeOffsetAssertions, DateTimeOffset>

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