OJMoq Class Reference

List of all members.

## Public Member Functions

(void) | - forwardInvocation:`[implementation]`
(id) | - initWithBaseObject:`[implementation]`
(CPMethodSignature) | - methodSignatureForSelector:`[implementation]`
(BOOL) | - respondsToSelector:`[implementation]`
(OJMoq) | - selector:callback:`[implementation]`
(OJMoq) | - selector:callback:arguments:`[implementation]`
(OJMoq) | - selector:returns:`[implementation]`
(OJMoq) | - selector:returns:arguments:`[implementation]`
(OJMoq) | - selector:times:`[implementation]`
(OJMoq) | - selector:times:arguments:`[implementation]`
(OJMoq) | - verifyThatAllExpectationsHaveBeenMet`[implementation]`

## Static Public Member Functions

(id) | + mockBaseObject:`[implementation]`

## Detailed Description

A mocking library for Cappuccino applications

Definition at line 27 of file OJMoq.j.

## Member Function Documentation

- (void) forwardInvocation: |  | (CPInvocation) | anInvocation | `[implementation]`

Definition at line 202 of file OJMoq.j.

- (id) initWithBaseObject: |  | (CPObject) | aBaseObject | `[implementation]`

Creates an OJMoq object based on the base object. If the base object is nil, then a benign stub is created. If the base object is non-nil, it creates a spy mock that allows all of the messages to go through to the base object.

Parameters:

  aBaseObject | A nil or non-nil base object that will be wrapped by OJMoq

Returns:
  An instance of OJMoq that wraps the given base object

Definition at line 56 of file OJMoq.j.

- (CPMethodSignature) methodSignatureForSelector: |  | (SEL) | aSelector | `[implementation]`

Definition at line 196 of file OJMoq.j.

+ (id) mockBaseObject: |  | (CPObject) | aBaseObject | `[implementation]`

Creates an OJMoq object based on the base object. If the base object is nil, then a benign stub is created. If the base object is non-nil, it creates a spy mock that allows all of the messages to go through to the base object.

Parameters:

  aBaseObject | A nil or non-nil base object that will be wrapped by OJMoq

Returns:
  An instance of OJMoq that wraps the given base object

Definition at line 42 of file OJMoq.j.

- (BOOL) respondsToSelector: |  | (SEL) | aSelector | `[implementation]`

Definition at line 227 of file OJMoq.j.

- (OJMoq) selector: |  | (SEL) | aSelector
callback: |  | (Function) | aCallback
|  |  | `[implementation]`

Provides a callback with the parameters that were passed in to the specified selector

Parameters:

  aSelector | The selector on the base object that will be called
  aCallback | A single-argument function that is passed the array of arguments

Definition at line 146 of file OJMoq.j.

- (OJMoq) selector: |  | (SEL) | aSelector
callback: |  | (Function) | aCallback
arguments: |  | (CPArray) | arguments
|  |  | `[implementation]`

Provides a callback with the parameters that were passed in to the specified selector and match the given arguments

Parameters:

  aSelector | The selector on the base object that will be called
  aCallback | A single-argument function that is passed the array of arguments
  arguments | The arguments that the selector must match

Definition at line 159 of file OJMoq.j.

- (OJMoq) selector: |  | (SEL) | aSelector
returns: |  | (CPObject) | value
|  |  | `[implementation]`

Ensure that selector returns value when selector is called. Selector will match all arguments.

Parameters:

  aSelector | The selector on the base object that will be called
  value | The value that the selector should return

Definition at line 111 of file OJMoq.j.

- (OJMoq) selector: |  | (SEL) | aSelector
returns: |  | (CPObject) | value
arguments: |  | (CPArray) | arguments
|  |  | `[implementation]`

Ensure that the selector, when called with the specified arguments, will return the given value. If you pass an empty array of arguments, then the selector will match all calls.

Parameters:

  aSelector | The selector on the base object that will be called
  arguments | The arguments that must be passed to selector for this to work
  value | The value that the selector should return

Definition at line 124 of file OJMoq.j.

- (OJMoq) selector: |  | (SEL) | selector
times: |  | (CPNumber) | times
|  |  | `[implementation]`

Expect that selector is called times on the base object. The selector here will match all arguments.

Parameters:

  selector | The selector which should be called
  times | The number of times that selector should be called

Definition at line 73 of file OJMoq.j.

- (OJMoq) selector: |  | (SEL) | selector
times: |  | (CPNumber) | times
arguments: |  | (CPArray) | arguments
|  |  | `[implementation]`

Expect that selector is called times with arguments on the base object. The selector here will match the arguments that you pass it. If an empty array is passed then the selector will match all arguments!

Parameters:

  selector | The selector which should be called
  times | The number of times that selector should be called
  arguments | Arguments for the selector. If an empty array of arguments is passed in, then the selector matches all arguments.

Definition at line 88 of file OJMoq.j.

- (OJMoq) verifyThatAllExpectationsHaveBeenMet |  |  | `[implementation]`

Verifies all of the expectations that were set on the OJMoq and fails the test if any of the expectations fail.

Definition at line 179 of file OJMoq.j.

The documentation for this class was generated from the following file:

- Frameworks/OJMoq/OJMoq.j

All Classes Files Functions Variables