test case for validation function.