Add and test NewFile function