Yahoo! UI Library

test  3.0.0

Yahoo! UI Library > test > Test.Format.Mock
Search:
 
Filters

Class Test.Format.Mock

Creates a new mock object.

Constructor

Test.Format.Mock ( template )
Parameters:
template <Object> (Optional) An object whose methods should be stubbed out on the mock object.

Methods

expect

static void expect ( mock , expectation )
Assigns an expectation to a mock object. This is used to create methods and properties on the mock object that are monitored for calls and changes, respectively.
Parameters:
mock <Object> The object to add the expectation to.
expectation <Object> An object defining the expectation. For a method, the keys "method" and "args" are required with an optional "returns" key available. For properties, the keys "property" and "value" are required.

verify

static void verify ( mock )
Verifies that all expectations of a mock object have been met and throws an assertion error if not.
Parameters:
mock <Object> The object to verify..


Copyright © 2009 Yahoo! Inc. All rights reserved.