functions tests and exception messages