Unit test for reading and writing a regular file