Turn from: http://blog.csdn.net/jymn_chen/article/details/21552941 assertion test
The following is a total of 18 assertions (the SDK is also 18, meaning transferred from the iOS UnitTest learning notes, really admire the original blogger, some of the macro brother has been tested):
Xctfail (Format ...) generates a failed test;
Xctassertnil (A1, Format ...) For the null judgment, A1 is empty when passed, and vice versa;
Xctassertnotnil (A1, Format ...) Not for empty judgment, A1 is not empty when passed, and vice versa;
Xctassert (expression, format ...) Passed when expression evaluates to true;
Xctasserttrue (expression, format ...) Passed when expression evaluates to true;
Xctassertfalse (expression, format ...) Passed when expression evaluates to false;
Xctassertequalobjects (A1, A2, Format ...) Judgment is equal, [A1 ISEQUAL:A2] value is true when passed, one of which is not empty when not passed;
Xctassertnotequalobjects (A1, A2, Format ...) Judgment unequal, [A1 ISEQUAL:A2] value is false when passed;
Xctassertequal (A1, A2, Format ...) Judge Equality (when A1 and A2 are C scalar, struct, or union, the actual test finds that nsstring can also);
Xctassertnotequal (A1, A2, Format ...) Judgment unequal (used when A1 and A2 are C scalar, struct, or union);
Xctassertequalwithaccuracy (A1, a2, accuracy, Format ...) The judgment is equal, (double or float type) provides an error range, and passes the test when equal within the error range (+/-accuracy);
Xctassertnotequalwithaccuracy (A1, a2, accuracy, Format ...) The judgment is unequal, (double or float type) provides an error range, which passes the test when the error range is not equal;
Xctassertthrows (expression, format ...) Exception test, passed when expression has an exception; (very perverted) xctassertthrowsspecific (expression, specificexception, format ...) exception test, When expression has an specificexception exception, the other exception or no exception occurs;
xctassertthrowsspecificnamed (expression, specificexception, Exception_name, Format ...) Exception test, when expression has a specific exception, the exception of the specific exception name passed the test, and vice versa;
Xctassertnothrow (expression, format ...) An exception test, which passes the test when expression does not occur abnormally;
Xctassertnothrowspecific (expression, specificexception, format ...) Exception test, when expression does not have a specific exception, the specific exception name of the exception passed the test, and vice versa;
xctassertnothrowspecificnamed (expression, specificexception, Exception_name, Format ...) An exception test that passes the test when expression does not have an exception that has a specific exception, a specific exception name, and vice versa.