Equality and Inequality Assertions

Check whether two values are equal or unequal.

Topics

Testing for Equality and Inequality

XCTAssertEqual

Asserts that two expressions have the same value.

XCTAssertEqualObjects

Asserts that two objects are considered equal.

XCTAssertNotEqual

Asserts that two expressions do not have the same value.

XCTAssertNotEqualObjects

Asserts that two objects are not considered equal.

Testing for Equality Within a Given Accuracy

XCTAssertEqualWithAccuracy

Asserts that two expressions have the same value within a certain accuracy.

XCTAssertNotEqualWithAccuracy

Asserts that two expressions do not have the same value within a certain accuracy.

See Also

Test Assertions

Boolean Assertions

Test a condition that generates a true or false result.

Nil and Non-nil Assertions

Check whether a test condition is nil or non-nil.

Comparable Value Assertions

Compare two values to determine whether one is larger or smaller than the other.

NSException Assertions

Check whether a function call throws (or does not throw) an NSException.

Failing Unconditionally

Generate a failure immediately and unconditionally.