Objective-J Test API 0.1.0
OJAssert Class Reference

List of all members.

Static Public Member Functions

(void) + assert:equals: [implementation]
(void) + assert:equals:message: [implementation]
(void) + assert:matches: [implementation]
(void) + assert:notEqual: [implementation]
(void) + assert:notEqual:message: [implementation]
(void) + assert:notSame: [implementation]
(void) + assert:notSame:message: [implementation]
(void) + assert:same: [implementation]
(void) + assert:same:message: [implementation]
(void) + assertFalse: [implementation]
(void) + assertFalse:message: [implementation]
(void) + assertNoThrow: [implementation]
(void) + assertNotNull: [implementation]
(void) + assertNotNull:message: [implementation]
(void) + assertNull: [implementation]
(void) + assertNull:message: [implementation]
(void) + assertThrows: [implementation]
(void) + assertTrue:message: [implementation]
(void) + fail [implementation]
(void) + fail: [implementation]
(void) + failEqual:actual:message: [implementation]
(void) + failNotEqual:actual:message: [implementation]
(void) + failNotSame:actual:message: [implementation]
(void) + failSame:actual:message: [implementation]

Detailed Description

Definition at line 3 of file OJAssert.j.


Member Function Documentation

+ (void) assert: (id)  expected
equals: (id)  actual 
[implementation]

Assert that the expected value is equal to the actual value

Parameters:
expectedThe expected value
actualThe actual value

Definition at line 54 of file OJAssert.j.

+ (void) assert: (id)  expected
equals: (id)  actual
message: (CPString)  message 
[implementation]

Assert that the expected value is equal to the actual value and not equal then report the given message

Parameters:
expectedThe expected value
actualThe actual value
messageThe failure message

Definition at line 67 of file OJAssert.j.

+ (void) assert: (CPString)  aRegex
matches: (CPString)  aString 
[implementation]

Assert that the given Regular Expression matches the given string. The regular expression should be passed as a double escaped string. For example, testing one or more digits is [OJAssert assert:"\\d+" equals:"123"];

Parameters:
aRegexA string that represents a regular expression (e.g. "^(\.*)$")
aStringThe string to test the regular expression against

Definition at line 231 of file OJAssert.j.

+ (void) assert: (id)  expected
notEqual: (id)  actual 
[implementation]

Assert that the expected value is not equal to the actual value

Parameters:
expectedThe expected value
actualThe actual value

Definition at line 79 of file OJAssert.j.

+ (void) assert: (id)  expected
notEqual: (id)  actual
message: (CPString)  message 
[implementation]

Assert that the expected value is not equal to the actual value and if equal then report the given message

Parameters:
expectedThe expected value
actualThe actual value
messageThe failure message

Definition at line 92 of file OJAssert.j.

+ (void) assert: (id)  expected
notSame: (id)  actual 
[implementation]

Assert that the expected object and the actual object are not the same object.

Parameters:
expectedThe expected value
actualThe actual value

Definition at line 129 of file OJAssert.j.

+ (void) assert: (id)  expected
notSame: (id)  actual
message: (CPString)  message 
[implementation]

Assert that the expected object and the actual object are not the same object. If they are the same, then report the given message.

Parameters:
expectedThe expected value
actualThe actual value
messageThe failure message

Definition at line 142 of file OJAssert.j.

+ (void) assert: (id)  expected
same: (id)  actual 
[implementation]

Assert that the expected object and the actual object are the same object.

Parameters:
expectedThe expected value
actualThe actual value

Definition at line 104 of file OJAssert.j.

+ (void) assert: (id)  expected
same: (id)  actual
message: (CPString)  message 
[implementation]

Assert that the expected object and the actual object are the same object. If they are different, then report the given message.

Parameters:
expectedThe expected value
actualThe actual value
messageThe failure message

Definition at line 117 of file OJAssert.j.

+ (void) assertFalse: (BOOL)  condition [implementation]

Assert that the given condition is false

Parameters:
conditionThe condition to verify

Definition at line 32 of file OJAssert.j.

+ (void) assertFalse: (BOOL)  condition
message: (CPString)  message 
[implementation]

Assert that the given condition is false and if not false then report the given message

Parameters:
conditionThe condition to verify
messageThe failure message

Definition at line 43 of file OJAssert.j.

+ (void) assertNoThrow: (Function)  zeroArgClosure [implementation]

Assert that the zero argument closure that is given does not throw an exception.

Parameters:
zeroArgClosureThe zero argument closure that will be run.

Example:

[self assertNoThrow:function(){[myObject myMessage:myArgument];}];

Definition at line 198 of file OJAssert.j.

+ (void) assertNotNull: (id)  object [implementation]

Assert that the given object is not null.

Parameters:
objectThe given object

Definition at line 173 of file OJAssert.j.

+ (void) assertNotNull: (id)  object
message: (CPString)  message 
[implementation]

Assert that the given object is not null. If it is null, report the given message.

Parameters:
objectThe given object
messageThe failure message

Definition at line 184 of file OJAssert.j.

+ (void) assertNull: (id)  object [implementation]

Assert that the given object is null

Parameters:
objectThe given object

Definition at line 153 of file OJAssert.j.

+ (void) assertNull: (id)  object
message: (CPString)  message 
[implementation]

Assert that the given object is null. If it is not null, report the given message.

Parameters:
aparameter

Definition at line 163 of file OJAssert.j.

+ (void) assertThrows: (Function)  zeroArgClosure [implementation]

Assert that the zero argument closure that is given does throw an exception.

Parameters:
zeroArgClosureThe zero argument closure that will be run.

Example:

[self assertThrows:function(){[myObject myMessage:myArgument];}];

Definition at line 215 of file OJAssert.j.

+ (void) assertTrue: (BOOL)  condition
message: (CPString)  message 
[implementation]

Assert that the given condition is true and if it is not report the given message

Parameters:
conditionThe condition to verify
messageThe failure message

Definition at line 21 of file OJAssert.j.

+ (void) fail [implementation]

Fails the test case.

Definition at line 240 of file OJAssert.j.

+ (void) fail: (CPString)  message [implementation]

Fails the test case and reports the given message.

Parameters:
messageThe failure message

Definition at line 250 of file OJAssert.j.

+ (void) failEqual: (id)  expected
actual: (id)  actual
message: (CPString)  message 
[implementation]

Definition at line 266 of file OJAssert.j.

+ (void) failNotEqual: (id)  expected
actual: (id)  actual
message: (CPString)  message 
[implementation]

Definition at line 272 of file OJAssert.j.

+ (void) failNotSame: (id)  expected
actual: (id)  actual
message: (CPString)  message 
[implementation]

Definition at line 260 of file OJAssert.j.

+ (void) failSame: (id)  expected
actual: (id)  actual
message: (CPString)  message 
[implementation]

Definition at line 255 of file OJAssert.j.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables