function validate(assert, sTypeName, oConstraints, sExpectedErrorKey) {
		var oDate = new Date(),
			oType = createInstance(sTypeName, undefined, oConstraints);

		oType.validateValue(null);

		oConstraints.nullable = false;
		oType = createInstance(sTypeName, undefined, oConstraints);
		validateError(assert, oType, null, sExpectedErrorKey, "nullable");

		[undefined, false, 0, 1, "foo"].forEach(function (vValue) {
			try {
				oType.validateValue(vValue);
				assert.ok(false);
			} catch (e) {
				assert.ok(e instanceof ValidateException);
				assert.strictEqual(e.message, "Illegal " + sTypeName + " value: " + vValue, vValue);
			}
		});
		oDate.setFullYear(0);
		validateError(assert, oType, oDate, sExpectedErrorKey, "year 0");
		oType.validateValue(new Date());
	}
/*
	 * Tests the validation for a DateTime with the given constraints.
	 */
Tests the validation for a DateTime with the given constraints.
Tests the validation for a DateTime with the given constraints .
function validate(assert, sTypeName, oConstraints, sExpectedErrorKey) {
		var oDate = new Date(),
			oType = createInstance(sTypeName, undefined, oConstraints);
		oType.validateValue(null);
		oConstraints.nullable = false;
		oType = createInstance(sTypeName, undefined, oConstraints);
		validateError(assert, oType, null, sExpectedErrorKey, "nullable");
		[undefined, false, 0, 1, "foo"].forEach(function (vValue) {
			try {
				oType.validateValue(vValue);
				assert.ok(false);
			} catch (e) {
				assert.ok(e instanceof ValidateException);
				assert.strictEqual(e.message, "Illegal " + sTypeName + " value: " + vValue, vValue);
			}
		});
		oDate.setFullYear(0);
		validateError(assert, oType, oDate, sExpectedErrorKey, "year 0");
		oType.validateValue(new Date());
	}
function validate ( assert , sTypeName , oConstraints , sExpectedErrorKey ) { var oDate = new Date ( ) , oType = createInstance ( sTypeName , undefined , oConstraints ) ; oType . validateValue ( null ) ; oConstraints . nullable = false ; oType = createInstance ( sTypeName , undefined , oConstraints ) ; validateError ( assert , oType , null , sExpectedErrorKey , "nullable" ) ; [ undefined , false , 0 , 1 , "foo" ] . forEach ( function ( vValue ) { try { oType . validateValue ( vValue ) ; assert . ok ( false ) ; } catch ( e ) { assert . ok ( e instanceof ValidateException ) ; assert . strictEqual ( e . message , "Illegal " + sTypeName + " value: " + vValue , vValue ) ; } } ) ; oDate . setFullYear ( 0 ) ; validateError ( assert , oType , oDate , sExpectedErrorKey , "year 0" ) ; oType . validateValue ( new Date ( ) ) ; }
Tests the validation for a DateTime with the given constraints.
Tests the validation for a DateTime with the given constraints .