Updated checkForValidFilename to only require a filename and moved the dialog logic out of the method. Also added unit tests for the checkForValidFilename method.