/// <summary> /// 确认路径是文件还是目录 /// 如果是目录则创建Results.txt文件,返回 /// 如果是文件,返回 /// 路径不正常则抛出异常 /// </summary> /// <param name="filePath">文件路径</param> /// <returns>返回文件路径</returns> internal static string CheckFilePath(string filePath) { if (!ModuleUtil.IsTxtFile(filePath)) { if (!ModuleUtil.IsValidDirectory(filePath)) { throw new TestflowDataException(ModuleErrorCode.InvalidFilePath, $"Invalid File or Directory Path: {filePath}"); } filePath += "Results.txt"; } return(filePath); }