Added file write tests