Do not assume the unit tests can write in the application directory (e.g. iOS devices). Use the temporary directory and open files in read-only