Skip to content

NumericAssertions<TSelf, T> Class ​

Definition ​

Base class for assertions on numeric values, and other values that have a zero and a sign such as TimeSpan.

c#
public abstract class NumericAssertions<TSelf, T> : ComparableAssertions<TSelf, T>
   where TSelf : NumericAssertions<TSelf, T>
   where T : IComparable<T>

View source

Type Parameters ​

NameDescription
TSelfThe type of the derived assertions class, returned from And to allow chaining.
TThe type of the value being asserted on.

Constructors ​

NameDescription
NumericAssertions(T, T)Base class for assertions on numeric values, and other values that have a zero and a sign such as TimeSpan.

Methods ​

NameDescription
BeNegative()Asserts that the value is negative (less than zero).
BePositive()Asserts that the value is positive (greater than zero).
BeZero()Asserts that the value is zero.
NotBeNegative()Asserts that the value is not negative (not less than zero).
NotBePositive()Asserts that the value is not positive (not greater than zero).
NotBeZero()Asserts that the value is not zero.