include calendar.util.CalendarUtil

include logger.util.LoggerUtil

include string.util.StringUtil
include string.Validator.StringValidator

TestUtil(){
	_getLogMsg(){
		local _message=$(StringUtil capitalize ${2})
		local time=$(CalendarUtil getTimestamp log)

		if [[ $(StringValidator isSubstring ${2} PASSED) ]]; then
			local message=$(colorme green $(StringUtil replace _message _ space))

		else
			local message=$(StringUtil parseMessage _message)
		fi

		echo -e "${time} [ $(LoggerUtil _formatLogLevel ${1}) ] ${message}"
	}

	assertEquals(){
		if [[ ${1} == ${2} ]]; then
			echo PASS
		else
			echo FAIL
		fi
	}

	assertNull(){
		if [[ ${1} == "" ]]; then
			echo PASS
		else
			echo FAIL
		fi
	}

	assertTrue(){
		if [[ ${1} == true ]]; then
			echo PASS
		else
			echo FAIL
		fi
	}

	logSuccessMsg(){
		_getLogMsg info ${1}
	}

	$@
}
include calendar.util.CalendarUtil

include logger.util.LoggerUtil

include string.util.StringUtil
include string.Validator.StringValidator

TestUtil(){
	_getLogMsg(){
		local _message=$(StringUtil capitalize ${2})
		local time=$(CalendarUtil getTimestamp log)

		if [[ $(StringValidator isSubstring ${2} PASSED) ]]; then
			local message=$(colorme green $(StringUtil replace _message _ space))

		else
			local message=$(StringUtil parseMessage _message)
		fi

		echo -e "${time} [ $(LoggerUtil _formatLogLevel ${1}) ] ${message}"
	}

	assertContains(){
		if [[ $(readvar ${1}) =~ $(readvar ${2}) ]]; then
			echo PASS
		else
			echo FAIL
		fi
	}

	assertEquals(){
		if [[ ${1} == ${2} ]]; then
			echo PASS
		else
			echo FAIL
		fi
	}

	assertNull(){
		if [[ ${1} == "" ]]; then
			echo PASS
		else
			echo FAIL
		fi
	}

	assertTrue(){
		if [[ ${1} == true ]]; then
			echo PASS
		else
			echo FAIL
		fi
	}

	logSuccessMsg(){
		_getLogMsg info ${1}
	}

	$@
}
Add function to test substring
Add function to test substring
