finished unit tests for function contracts