OCHamcrest
Defines
Unit Tests of Primitive Numbers
Unit Test Integration

Unit test integration for primitive numbers.
More...

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.

Detailed Description

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 Documentation

assertThatBool(actual, matcher) - Asserts that BOOL actual value, converted to an NSNumber, satisfies matcher.

Parameters:
actualThe BOOL value to convert to an NSNumber for evaluation.
matcherThe 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.)

assertThatChar(actual, matcher) - Asserts that char actual value, converted to an NSNumber, satisfies matcher.

Parameters:
actualThe char value to convert to an NSNumber for evaluation.
matcherThe 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.)

HC_assertThatDouble(actual, matcher) - Asserts that double actual value, converted to an NSNumber, satisfies matcher.

Parameters:
actualThe double value to convert to an NSNumber for evaluation.
matcherThe 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.)

assertThatFloat(actual, matcher) - Asserts that float actual value, converted to an NSNumber, satisfies matcher.

Parameters:
actualThe float value to convert to an NSNumber for evaluation.
matcherThe 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.)

assertThatInt(actual, matcher) - Asserts that int actual value, converted to an NSNumber, satisfies matcher.

Parameters:
actualThe int value to convert to an NSNumber for evaluation.
matcherThe 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.

Parameters:
actualThe NSInteger value to convert to an NSNumber for evaluation.
matcherThe 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.)

assertThatLong(actual, matcher) - Asserts that long actual value, converted to an NSNumber, satisfies matcher.

Parameters:
actualThe long value to convert to an NSNumber for evaluation.
matcherThe 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.

Parameters:
actualThe long long value to convert to an NSNumber for evaluation.
matcherThe 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.)

assertThatShort(actual, matcher) - Asserts that short actual value, converted to an NSNumber, satisfies matcher.

Parameters:
actualThe short value to convert to an NSNumber for evaluation.
matcherThe 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.

Parameters:
actualThe unsigned char value to convert to an NSNumber for evaluation.
matcherThe 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.

Parameters:
actualThe unsigned int value to convert to an NSNumber for evaluation
matcherThe 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.

Parameters:
actualThe NSUInteger value to convert to an NSNumber for evaluation.
matcherThe 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.

Parameters:
actualThe unsigned long value to convert to an NSNumber for evaluation
matcherThe 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.

Parameters:
actualThe unsigned long long value to convert to an NSNumber for evaluation
matcherThe 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.

Parameters:
actualThe unsigned short value to convert to an NSNumber for evaluation
matcherThe 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.)