예제 #1
0
        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);
        }
예제 #2
0
        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);
        }