NumericAssertions class

Contains a number of methods to assert that a num is in the expected state.

Inheritance

Constructors

NumericAssertions(num? subject, {bool isReversed = false, String? subjectLabel})
Initializes a new instance of the NumericAssertions class.

Properties

and NumericAssertions
Bind assertions
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
isReversed bool
Checking reverse
finalinherited
not NumericAssertions
Invert assertion
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
subject num?
the object which value is being asserted.
finalinherited
subjectLabel String
Friendly label for the subject object
no setterinherited

Methods

as(String subjectLabel) NumericAssertions
Set friendly title for the subject
inherited
be(num expected) NumericAssertions
Asserts that the value is equal to the specified expected value. expected The expected value
inherited
beAbove(num expected) NumericAssertions
Asserts that the numeric value is greater than the specified expected value.
beAssignableTo<U>() → U?
Asserts that the object is assignable to a variable of type U
inherited
beBelow(num expected) NumericAssertions
Asserts that the numeric value is less than the specified expected value.
beCloseTo(num nearbyValue, {required num delta}) NumericAssertions
Asserts an numeric value is close to another value within a specified value.
beEven() NumericAssertions
Asserts that the numeric value is even.
beGreaterOrEqualThan(num expected) NumericAssertions
Asserts that the numeric value is greater or equal than the specified expected value.
beGreaterThan(num expected) NumericAssertions
Asserts that the numeric value is odd.
beLessOrEqualThan(num expected) NumericAssertions
Asserts that the numeric value is less or equal than the specified expected value.
beLessThan(num expected) NumericAssertions
Asserts that the numeric value is less than the specified expected value.
beNegative() NumericAssertions
Asserts that the numeric value is less than zero.
beNull() NumericAssertions
Asserts that the object is not null
inherited
beOdd() NumericAssertions
Asserts that the numeric value is odd.
beOfType<U>() → U?
Asserts that the object is not of the specified type U
inherited
beOneOf(Iterable<num> validItems) NumericAssertions
Asserts that a value is one of the specified validItems
inherited
bePositive() NumericAssertions
Asserts that the numeric value is greater or equal than zero.
beTolerantOf(num nearbyValue, {required double tolerance}) NumericAssertions
Asserts an numeric value is close to another value within a specified value.
beWithin(num min, num max) NumericAssertions
Asserts that a value is within a range.
beZero() NumericAssertions
Asserts that the numeric value is 0.
copy(num? subject, {bool isReversed = false, String? subjectLabel}) NumericAssertions
Copy the matcher
override
isEqual(num expected) bool
Comparison with an another expected value
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited