objectassert-tests.js revision 33d85edf47749fa345d7b636b9b4b9d0d0386f44
ObjectAssert = Y.ObjectAssert;
//-------------------------------------------------------------------------
// Base Test Suite
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
// Test Case for hasKey()
//-------------------------------------------------------------------------
name : "hasKey() Tests",
_should: {
fail: {
"hasKey() should fail for missing key": "Property 'yui' not found on object."
}
},
/*
* Tests that hasKey() passes when a property with the given
* name exists on the object instance.
*/
"hasKey() should pass for existing key on instance": function(){
},
/*
* Tests that hasKey() passes when a property with the given
* name exists on the object prototype.
*/
"hasKey() should pass for existing key on prototype": function(){
},
/*
* Tests that hasKey() fails when a property with the given
* name doesn't exist on the object or its prototype.
*/
"hasKey() should fail for missing key": function(){
}
}));
//-------------------------------------------------------------------------
// Test Case for hasKeys()
//-------------------------------------------------------------------------
name : "hasKeys() Tests",
_should: {
fail: {
"hasKeys() should fail for missing key on object": "Property 'yui' not found on object.",
"hasKeys() should fail for missing key on prototype": "Property 'yui' not found on object."
}
},
/*
* Tests that hasKeys() passes when properties with the given
* names exist on the object instance.
*/
"hasKeys() should pass for existing key on instance": function(){
},
/*
* Tests that hasKeys() passes when properties with the given
* names exists on the object prototype.
*/
"hasKeys() should pass for existing key on prototype": function(){
},
/*
* Tests that hasKeys() fails when a property with the given
* name doesn't exist on the object instance.
*/
"hasKeys() should fail for missing key on object": function(){
},
/*
* Tests that hasKeys() fails when a property with the given
* name doesn't exist on the object prototype.
*/
"hasKeys() should fail for missing key on prototype": function(){
}
}));
//-------------------------------------------------------------------------
// Test Case for ownsKey()
//-------------------------------------------------------------------------
name : "ownsKey() Tests",
_should: {
fail: {
"ownsKey() should fail for existing key on prototype": "Property 'msg' not found on object instance.",
"ownsKey() should fail for missing key": "Property 'yui' not found on object instance."
}
},
/*
* Tests that ownsKey() passes when a property with the given
* name exists on the object instance.
*/
"ownsKey() should pass for existing key on instance": function(){
},
/*
* Tests that ownsKey() fails when a property with the given
* name exists on the object prototype.
*/
"ownsKey() should fail for existing key on prototype": function(){
},
/*
* Tests that ownsKey() fails when a property with the given
* name doesn't exist on the object.
*/
"ownsKey() should fail for missing key": function(){
}
}));
//-------------------------------------------------------------------------
// Test Case for ownsKeys()
//-------------------------------------------------------------------------
name : "ownsKeys() Tests",
_should: {
fail: {
"ownsKeys() should fail for existing key on prototype": "Property 'msg' not found on object instance.",
"ownsKeys() should fail for missing key on prototype": "Property 'msg' not found on object instance.",
"ownsKeys() should fail for missing key on object": "Property 'yui' not found on object instance.",
"ownsKeys() should fail for missing key on prototype": "Property 'yui' not found on object instance."
}
},
/*
* Tests that ownsKeys() passes when properties with the given
* names exist on the object instance.
*/
"ownsKeys() should pass for existing key on instance": function(){
},
/*
* Tests that ownsKeys() fails when properties with the given
* names exists on the object prototype.
*/
"ownsKeys() should fail for existing key on prototype": function(){
},
/*
* Tests that ownsKeys() fails when a property with the given
* name doesn't exist on the object instance.
*/
"ownsKeys() should fail for missing key on object": function(){
},
/*
* Tests that ownsKeys() fails when a property with the given
* name exists only on the object prototype.
*/
"ownsKeys() should fail for missing key on prototype": function(){
},
/*
* Tests that ownsKeys() fails when a property with the given
* name doesn't exist on the object prototype.
*/
"ownsKeys() should fail for missing key on prototype": function(){
}
}));
//-------------------------------------------------------------------------
// Test Case for ownsNoKeys()
//-------------------------------------------------------------------------
name : "ownsNoKeys() Tests",
_should: {
fail: {
"ownsNoKeys() should fail for object with one key": "Object owns 1 properties but should own none.",
"ownsNoKeys() should fail for object with two keys": "Object owns 2 properties but should own none."
}
},
/*
* Tests that ownsNoKeys() fails when the object owns a single property.
*/
"ownsNoKeys() should fail for object with one key": function(){
},
/*
* Tests that ownsNoKeys() fails when the object owns two properties.
*/
"ownsNoKeys() should fail for object with two keys": function(){
},
/*
* Tests that ownsNoKeys() passes when the object owns no properties.
*/
"ownsNoKeys() should pass for object with no keys": function(){
var object = {};
}
}));
name : "Object Asserts",
"test: areEqual()": function(){
}
}));
});