Add WriteFile test code