Yahoo! UI Library

test  3.3.0pr1

Yahoo! UI Library > test > Mock.Value.ObjectAssert
Search:
 
Filters

static Class Mock.Value.ObjectAssert

The ObjectAssert object provides functions to test JavaScript objects for a variety of cases.

Methods

hasKey

static void hasKey ( propertyName , object , message )
Asserts that an object has a property with the given name. The property may exist either on the object instance or in its prototype chain. The same as testing "property" in object.
Parameters:
propertyName <String> The name of the property to test.
object <Object> The object to search.
message <String> (Optional) The message to display if the assertion fails.

hasKeys

static void hasKeys ( properties , object , message )
Asserts that an object has all properties of a reference object. The properties may exist either on the object instance or in its prototype chain. The same as testing "property" in object.
Parameters:
properties <Array> An array of property names that should be on the object.
object <Object> The object to search.
message <String> (Optional) The message to display if the assertion fails.

ownsKey

static void ownsKey ( propertyName , object , message )
Asserts that a property with the given name exists on an object instance (not on its prototype).
Parameters:
propertyName <String> The name of the property to test.
object <Object> The object to search.
message <String> (Optional) The message to display if the assertion fails.

ownsKeys

static void ownsKeys ( properties , object , message )
Asserts that all properties exist on an object instance (not on its prototype).
Parameters:
properties <Array> An array of property names that should be on the object.
object <Object> The object to search.
message <String> (Optional) The message to display if the assertion fails.

ownsNoKeys

static void ownsNoKeys ( object , message )
Asserts that an object owns no properties.
Parameters:
object <Object> The object to check.
message <String> (Optional) The message to display if the assertion fails.


Copyright © 2010 Yahoo! Inc. All rights reserved.