# Yahoo! UI Library

### test 3.0.0

Yahoo! UI Library > test > Assert.ObjectAssert
Search:
Filters
Show Private Show Protected Show Deprecated

## `static` Class Assert.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.

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.

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 © 2009 Yahoo! Inc. All rights reserved.