Skip to content

DateTimeOffsetAssertions Class ​

Definition ​

Provides assertions for DateTimeOffset values.

c#
public sealed class DateTimeOffsetAssertions : ComparableAssertions<DateTimeOffsetAssertions, DateTimeOffset>

View source

Constructors ​

NameDescription
DateTimeOffsetAssertions(DateTimeOffset)Provides assertions for DateTimeOffset values.

Methods ​

NameDescription
BeAfter(DateTimeOffset)Asserts that the DateTimeOffset value is after the expected value.
BeApproximately(DateTimeOffset, TimeSpan)Asserts that the DateTimeOffset value is within the specified precision of the expected value.
BeBefore(DateTimeOffset)Asserts that the DateTimeOffset value is before the expected value.
BeExactly(DateTimeOffset)Asserts that the DateTimeOffset value represents the same point in time and has the same offset as the expected value.
BeOnOrAfter(DateTimeOffset)Asserts that the DateTimeOffset value is on or after the expected value.
BeOnOrBefore(DateTimeOffset)Asserts that the DateTimeOffset value is on or before the expected value.
HaveOffset(TimeSpan)Asserts that the DateTimeOffset value has the expected offset from UTC.
NotBeApproximately(DateTimeOffset, TimeSpan)Asserts that the DateTimeOffset value is not within the specified precision of the specified value.
NotBeExactly(DateTimeOffset)Asserts that the DateTimeOffset value does not represent the same point in time with the same offset as the specified value.