Unit test for writing to file - to be verified using hex editor