private string GetTargetFolderPath(string rootFolder) { ThrowExceptionIfPathPartIsEmpty(rootFolder, "root folder"); ThrowExceptionIfPathPartIsEmpty(ExecutionIdAndTitle, "Test Execution Id and Title"); ThrowExceptionIfPathPartIsEmpty(IdAndTitle, "Test Case Id and Title"); string result = Path.Combine( PathCleaner.GetPathWithoutInvalidChars(rootFolder), PathCleaner.GetPathWithoutInvalidChars(ExecutionIdAndTitle), PathCleaner.GetPathWithoutInvalidChars(IdAndTitle)); return(result); }
public ScreenshotFileInfoDto GenerateFileInfoForTestCaseItem(TestCaseItemInfoDto itemInfoDto) { string targetFolder = GetTargetFolderPath(itemInfoDto.RootFolder); ScreenshotFileInfoDto screenshotFileInfoDto = GenerateFileInfo(itemInfoDto.Item); screenshotFileInfoDto.Path = Path.Combine( targetFolder, PathCleaner.GetPathWithoutInvalidChars(screenshotFileInfoDto.Path)); screenshotFileInfoDto.TransformFileNames( s => { string result = PathCleaner.GetFileNameWithoutInvalidChars(s); result += "." + itemInfoDto.ImageFormat.ToString().ToLower(); return(result); } ); return(screenshotFileInfoDto); }