-
Notifications
You must be signed in to change notification settings - Fork 220
UnitKit
A minimalistic unit test framework UnitKit can be used to test Objective-C code.
@implementation TestSuite
// add tests here
// test methods must start with `test`
- (void)testAdd
{
// add assertions here
UKIntsEqual(2, add(1, 1));
}
@end
source: UKTest.h
Reports a success.
Reports a failure.
Tests that an expression is true
.
Tests that an expression is false
.
Tests that ref == nil
.
Tests that ref != nil
.
Tests that two primitive integers are equal.
a
is the expected value and b
the tested value.
Don’t pass unsigned long long
integers that cannot safely casted to long long
.
Tests that two primitive integers are not equal.
a
is the non-expected value and b
the tested value.
Don’t pass unsigned long long
integers that cannot safely casted to long long
.
Tests that two primitive floats are equal or almost equal, fabs(a - b) <= d
.
d
is the error margin.
a
is the expected value and b
the tested value.
Tests that two primitive floats are not equal, fabs(a - b) > d
.
d
is the error margin.
a
is the non-expected value and b
the tested value.
Tests that a
is a subclass of b
.
Tests that [a isEqual: b]
.
a
is the expected value and b
the tested value.
Tests that ![a isEqual: b]
.
a
is the non-expected value and b
the tested value.
Tests that the objects are identical with a == b
.
a
is the expected value and b
the tested value.
Tests that the objects are not identical with a != b
.
a
is the non-expected value and b
the tested value.
Tests that [a isEqual: b]
.
a
is the expected value and b
the tested value.
Tests that ![a isEqual: b]
.
a
is the non-expected value and b
the tested value.
Tests that b
is a substring of a
.
Tests that b
is not a substring of a
.
Tests that the code piece raises an exception.
Tests that the code piece raises no exception.
Tests that the code piece raises an exception of the name b
.
Tests that the code piece raises an exception of the class name b
.