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:

  expected | The expected value
  actual | The 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:

  expected | The expected value
  actual | The actual value
  message | The 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:

  aRegex | A string that represents a regular expression (e.g. "^(\.*)$")
  aString | The 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:

  expected | The expected value
  actual | The 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:

  expected | The expected value
  actual | The actual value
  message | The 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:

  expected | The expected value
  actual | The 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:

  expected | The expected value
  actual | The actual value
  message | The 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:

  expected | The expected value
  actual | The 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:

  expected | The expected value
  actual | The actual value
  message | The failure message

Definition at line 117 of file OJAssert.j.

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

Assert that the given condition is false

Parameters:

  condition | The 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:

  condition | The condition to verify
  message | The 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:

  zeroArgClosure | The 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:

  object | The 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:

  object | The given object
  message | The failure message

Definition at line 184 of file OJAssert.j.

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

Assert that the given object is null

Parameters:

  object | The 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:

  a | parameter

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:

  zeroArgClosure | The 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:

  condition | The condition to verify
  message | The 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:

  message | The 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:

- Frameworks/OJUnit/OJAssert.j

All Classes Files Functions Variables