1
0
Fork 0

added test case

This commit is contained in:
Jan Steemann 2013-03-08 14:38:08 +01:00
parent 0a883f4076
commit 69fc6e1662
1 changed files with 16 additions and 0 deletions

View File

@ -215,6 +215,22 @@ function CollectionDocumentSuite () {
wait(0.0);
},
////////////////////////////////////////////////////////////////////////////////
/// @brief create a document w/ invalid primary key data types
////////////////////////////////////////////////////////////////////////////////
testSaveInvalidDocumentKeyType : function () {
[ 1, 2, 3, false, true, null, [ ], { } ].forEach(function (key) {
try {
collection.save({ _key: key });
fail();
}
catch (err) {
assertEqual(ERRORS.ERROR_ARANGO_DOCUMENT_KEY_BAD.code, err.errorNum);
}
});
},
////////////////////////////////////////////////////////////////////////////////
/// @brief create a document w/ primary key violation
////////////////////////////////////////////////////////////////////////////////