OCHamcrest
|
Matchers that perform numeric comparisons.
Modules | |
Primitive Number Matchers | |
Matchers for testing equality against primitive numeric types. | |
Defines | |
#define | closeTo HC_closeTo |
closeTo(aValue, aDelta) - Matches if object is a number close to a given value, within a given delta. | |
#define | greaterThan HC_greaterThan |
greaterThan(aNumber) - Matches if object is greater than a given number. | |
#define | greaterThanOrEqualTo HC_greaterThanOrEqualTo |
greaterThanOrEqualTo(aNumber) - Matches if object is greater than or equal to a given number. | |
#define | lessThan HC_lessThan |
lessThan(aNumber) - Matches if object is less than a given number. | |
#define | lessThanOrEqualTo HC_lessThanOrEqualTo |
lessThanOrEqualTo(aNumber) - Matches if object is less than or equal to a given number. |
Matchers that perform numeric comparisons.
#define closeTo HC_closeTo |
closeTo(aValue, aDelta) - Matches if object is a number close to a given value, within a given delta.
aValue | The double value to compare against as the expected value. |
aDelta | The double maximum delta between the values for which the numbers are considered close. |
This matcher invokes -doubleValue
on the evaluated object to get its value as a double
. The result is compared against aValue to see if the difference is within a positive aDelta.
Example:
(In the event of a name clash, don't #define HC_SHORTHAND
and use the synonym HC_closeTo
instead.)
#define greaterThan HC_greaterThan |
greaterThan(aNumber) - Matches if object is greater than a given number.
aNumber | The NSNumber to compare against. |
Example:
(In the event of a name clash, don't #define HC_SHORTHAND
and use the synonym HC_greaterThan
instead.)
greaterThanOrEqualTo(aNumber) - Matches if object is greater than or equal to a given number.
aNumber | The NSNumber to compare against. |
Example:
(In the event of a name clash, don't #define HC_SHORTHAND
and use the synonym HC_greaterThanOrEqualTo
instead.)
#define lessThan HC_lessThan |
lessThan(aNumber) - Matches if object is less than a given number.
aNumber | The NSNumber to compare against. |
Example:
(In the event of a name clash, don't #define HC_SHORTHAND
and use the synonym HC_lessThan
instead.)
lessThanOrEqualTo(aNumber) - Matches if object is less than or equal to a given number.
aNumber | The NSNumber to compare against. |
Example:
(In the event of a name clash, don't #define HC_SHORTHAND
and use the synonym HC_lessThanOrEqualTo
instead.)