OCHamcrest
|
Unit test integration for primitive numbers.
Defines | |
#define | assertThatBool HC_assertThatBool |
assertThatBool(actual, matcher) - Asserts that BOOL actual value, converted to an NSNumber , satisfies matcher. | |
#define | assertThatChar HC_assertThatChar |
assertThatChar(actual, matcher) - Asserts that char actual value, converted to an NSNumber , satisfies matcher. | |
#define | assertThatDouble HC_assertThatDouble |
HC_assertThatDouble(actual, matcher) - Asserts that double actual value, converted to an NSNumber , satisfies matcher. | |
#define | assertThatFloat HC_assertThatFloat |
assertThatFloat(actual, matcher) - Asserts that float actual value, converted to an NSNumber , satisfies matcher. | |
#define | assertThatInt HC_assertThatInt |
assertThatInt(actual, matcher) - Asserts that int actual value, converted to an NSNumber , satisfies matcher. | |
#define | assertThatLong HC_assertThatLong |
assertThatLong(actual, matcher) - Asserts that long actual value, converted to an NSNumber , satisfies matcher. | |
#define | assertThatLongLong HC_assertThatLongLong |
assertThatLongLong(actual, matcher) - Asserts that long long actual value, converted to an NSNumber , satisfies matcher. | |
#define | assertThatShort HC_assertThatShort |
assertThatShort(actual, matcher) - Asserts that short actual value, converted to an NSNumber , satisfies matcher. | |
#define | assertThatUnsignedChar HC_assertThatUnsignedChar |
assertThatUnsignedChar(actual, matcher) - Asserts that unsigned char actual value, converted to an NSNumber , satisfies matcher. | |
#define | assertThatUnsignedInt HC_assertThatUnsignedInt |
assertThatUnsignedInt(actual, matcher) - Asserts that unsigned int actual value, converted to an NSNumber , satisfies matcher. | |
#define | assertThatUnsignedLong HC_assertThatUnsignedLong |
assertThatUnsignedLong(actual, matcher) - Asserts that unsigned long actual value, converted to an NSNumber , satisfies matcher. | |
#define | assertThatUnsignedLongLong HC_assertThatUnsignedLongLong |
assertThatUnsignedLongLong(actual, matcher) - Asserts that unsigned long long actual value, converted to an NSNumber , satisfies matcher. | |
#define | assertThatUnsignedShort HC_assertThatUnsignedShort |
assertThatUnsignedShort(actual, matcher) - Asserts that unsigned short actual value, converted to an NSNumber , satisfies matcher. | |
#define | assertThatInteger HC_assertThatInteger |
assertThatInteger(actual, matcher) - Asserts that NSInteger actual value, converted to an NSNumber , satisfies matcher. | |
#define | assertThatUnsignedInteger HC_assertThatUnsignedInteger |
assertThatUnsignedInteger(actual, matcher) - Asserts that NSUInteger actual value, converted to an NSNumber , satisfies matcher. |
Unit test integration for primitive numbers.
The assertThat<Type>
macros convert the primitive actual value to an NSNumber
, passing that to the matcher for evaluation. If the matcher is not satisfied, an exception is thrown describing the mismatch.
This family of macros is designed to integrate well with OCUnit and other unit testing frameworks. Unmet assertions are reported as test failures. In Xcode, they can be clicked to reveal the line of the assertion.
#define assertThatBool HC_assertThatBool |
assertThatBool(actual, matcher) - Asserts that BOOL
actual value, converted to an NSNumber
, satisfies matcher.
actual | The BOOL value to convert to an NSNumber for evaluation. |
matcher | The matcher to satisfy as the expected condition. |
(In the event of a name clash, don't #define HC_SHORTHAND
and use the synonym HC_assertThatBool
instead.)
#define assertThatChar HC_assertThatChar |
assertThatChar(actual, matcher) - Asserts that char
actual value, converted to an NSNumber
, satisfies matcher.
actual | The char value to convert to an NSNumber for evaluation. |
matcher | The matcher to satisfy as the expected condition. |
(In the event of a name clash, don't #define HC_SHORTHAND
and use the synonym HC_assertThatChar
instead.)
#define assertThatDouble HC_assertThatDouble |
HC_assertThatDouble(actual, matcher) - Asserts that double
actual value, converted to an NSNumber
, satisfies matcher.
actual | The double value to convert to an NSNumber for evaluation. |
matcher | The matcher to satisfy as the expected condition. |
(In the event of a name clash, don't #define HC_SHORTHAND
and use the synonym HC_assertThatDouble
instead.)
#define assertThatFloat HC_assertThatFloat |
assertThatFloat(actual, matcher) - Asserts that float
actual value, converted to an NSNumber
, satisfies matcher.
actual | The float value to convert to an NSNumber for evaluation. |
matcher | The matcher to satisfy as the expected condition. |
(In the event of a name clash, don't #define HC_SHORTHAND
and use the synonym HC_assertThatFloat
instead.)
#define assertThatInt HC_assertThatInt |
assertThatInt(actual, matcher) - Asserts that int
actual value, converted to an NSNumber
, satisfies matcher.
actual | The int value to convert to an NSNumber for evaluation. |
matcher | The matcher to satisfy as the expected condition. |
(In the event of a name clash, don't #define HC_SHORTHAND
and use the synonym HC_assertThatInt
instead.)
assertThatInteger(actual, matcher) - Asserts that NSInteger
actual value, converted to an NSNumber
, satisfies matcher.
actual | The NSInteger value to convert to an NSNumber for evaluation. |
matcher | The matcher to satisfy as the expected condition. |
(In the event of a name clash, don't #define HC_SHORTHAND
and use the synonym HC_assertThatInteger
instead.)
#define assertThatLong HC_assertThatLong |
assertThatLong(actual, matcher) - Asserts that long
actual value, converted to an NSNumber
, satisfies matcher.
actual | The long value to convert to an NSNumber for evaluation. |
matcher | The matcher to satisfy as the expected condition. |
(In the event of a name clash, don't #define HC_SHORTHAND
and use the synonym HC_assertThatLong
instead.)
assertThatLongLong(actual, matcher) - Asserts that long long
actual value, converted to an NSNumber
, satisfies matcher.
actual | The long long value to convert to an NSNumber for evaluation. |
matcher | The matcher to satisfy as the expected condition. |
(In the event of a name clash, don't #define HC_SHORTHAND
and use the synonym HC_assertThatLongLong
instead.)
#define assertThatShort HC_assertThatShort |
assertThatShort(actual, matcher) - Asserts that short
actual value, converted to an NSNumber
, satisfies matcher.
actual | The short value to convert to an NSNumber for evaluation. |
matcher | The matcher to satisfy as the expected condition. |
(In the event of a name clash, don't #define HC_SHORTHAND
and use the synonym HC_assertThatShort
instead.)
assertThatUnsignedChar(actual, matcher) - Asserts that unsigned char
actual value, converted to an NSNumber
, satisfies matcher.
actual | The unsigned char value to convert to an NSNumber for evaluation. |
matcher | The matcher to satisfy as the expected condition. |
(In the event of a name clash, don't #define HC_SHORTHAND
and use the synonym HC_assertThatUnsignedChar
instead.)
assertThatUnsignedInt(actual, matcher) - Asserts that unsigned int
actual value, converted to an NSNumber
, satisfies matcher.
actual | The unsigned int value to convert to an NSNumber for evaluation |
matcher | The matcher to satisfy as the expected condition. |
(In the event of a name clash, don't #define HC_SHORTHAND
and use the synonym HC_assertThatUnsignedInt
instead.)
assertThatUnsignedInteger(actual, matcher) - Asserts that NSUInteger
actual value, converted to an NSNumber
, satisfies matcher.
actual | The NSUInteger value to convert to an NSNumber for evaluation. |
matcher | The matcher to satisfy as the expected condition. |
(In the event of a name clash, don't #define HC_SHORTHAND
and use the synonym HC_assertThatUnsignedInteger
instead.)
assertThatUnsignedLong(actual, matcher) - Asserts that unsigned long
actual value, converted to an NSNumber
, satisfies matcher.
actual | The unsigned long value to convert to an NSNumber for evaluation |
matcher | The matcher to satisfy as the expected condition. |
(In the event of a name clash, don't #define HC_SHORTHAND
and use the synonym HC_assertThatUnsignedLong
instead.)
assertThatUnsignedLongLong(actual, matcher) - Asserts that unsigned long long
actual value, converted to an NSNumber
, satisfies matcher.
actual | The unsigned long long value to convert to an NSNumber for evaluation |
matcher | The matcher to satisfy as the expected condition. |
(In the event of a name clash, don't #define HC_SHORTHAND
and use the synonym HC_assertThatUnsignedLongLong
instead.)
assertThatUnsignedShort(actual, matcher) - Asserts that unsigned short
actual value, converted to an NSNumber
, satisfies matcher.
actual | The unsigned short value to convert to an NSNumber for evaluation |
matcher | The matcher to satisfy as the expected condition. |
(In the event of a name clash, don't #define HC_SHORTHAND
and use the synonym HC_assertThatUnsignedShort
instead.)