Skip to content

FloatingPointAssertions<T> Class ​

Definition ​

Provides assertions for floating-point values.

c#
public sealed class FloatingPointAssertions<T> : NumericAssertions<FloatingPointAssertions<T>, T>
   where T : struct, IFloatingPoint<T>

View source

Type Parameters ​

NameDescription
TThe floating-point type of the value being asserted on.

Constructors ​

NameDescription
FloatingPointAssertions(T)Provides assertions for floating-point values.

Methods ​

NameDescription
BeApproximately(T, T)Asserts that the floating-point value is approximately equal to the expected value within the specified precision.
BeGreaterThan(T, T)Asserts that the floating-point value is greater than the expected value.
BeGreaterThanOrEqualTo(T, T)Asserts that the floating-point value is greater than or equal to the expected value.
BeInfinity()Asserts that the floating-point value is positive or negative infinity.
BeLessThan(T, T)Asserts that the floating-point value is less than the expected value.
BeLessThanOrEqualTo(T, T)Asserts that the floating-point value is less than or equal to the expected value.
BeNaN()Asserts that the floating-point value is NaN (not a number).
BeNegativeInfinity()Asserts that the floating-point value is negative infinity.
BePositiveInfinity()Asserts that the floating-point value is positive infinity.
NotBeInfinity()Asserts that the floating-point value is not positive or negative infinity.
NotBeNaN()Asserts that the floating-point value is not NaN (not a number).