/**
 * This file contains test functions.
 * 
 * @version 2009-11-10
 * @author <a href="mailto:r.tennapel@griponservice.nl?SUBJECT=assert.js">R. ten Napel, ing.</a>
 **/

/**
 * A static class with all the test functions.
 **/
Assert = new function() {
	/**
	 * Check if a value is true.
	 * 
	 * @param value			The value to check.
	 * 
	 * @return				If the test has succeeded.
	 **/
	this.isTrue = function(value) {
		return (value == true);
	};
	
	/**
	 * Check if a value is false.
	 * 
	 * @param value			The value to check.
	 * 
	 * @return				If the test has succeeded.
	 **/
	this.isFalse = function(value) {
		return (value == false);
	};
	
	/**
	 * Check if two values are the same.
	 * 
	 * @param value1		The first value to check.
	 * @param value2		The second value to check.
	 * 
	 * @return				If the test has succeeded.
	 **/
	this.same = function(value1, value2) {
		return (value1 == value2);
	};
	
	/**
	 * Check if two values are not the same.
	 * 
	 * @param value1		The first value to check.
	 * @param value2		The second value to check.
	 * 
	 * @return				If the test has succeeded.
	 **/
	this.notSame = function(value1, value2) {
		return !Assert.same(value1, value2);
	};
	
	/**
	 * Check if a value is null.
	 * 
	 * @param value			The value to check.
	 * 
	 * @return				If the test has succeeded.
	 **/
	this.isNull = function(value) {
		return (value == null);
	};
	
	/**
	 * Check if a value is not null.
	 * 
	 * @param value			The value to check.
	 * 
	 * @return				If the test has succeeded.
	 **/
	this.notNull = function(value) {
		return !Assert.isNull(value);
	};
	
	/**
	 * Check if a value is empty.
	 * 
	 * @param value			The value to check.
	 * 
	 * @return				If the test has succeeded.
	 **/
	this.isEmpty = function(value) {
		return (value == null || value == "");
	};
	
	/**
	 * Check if a value is not empty.
	 * 
	 * @param value			The value to check.
	 * 
	 * @return				If the test has succeeded.
	 **/
	this.isNotEmpty = function(value) {
		return !Assert.isEmpty(value);
	};
};
