Exemplo n.º 1
0
        /// <summary>
        /// Gets the path of the folder used by the test.
        /// </summary>
        /// <param name="testName">The name of test currently runnig that will used created path.</param>
        /// <param name="use">Whether the path is for Input, Expected Output or ActualOutput.</param>
        /// <returns></returns>
        private static string GetTestFolderPath(string testSubpath, string testName, TestHelper.TestFolders use)
        {
            string folderName = Enum.GetName(typeof(TestHelper.TestFolders), use);

            string testFolderPath = Path.Combine(TestDataPath, testSubpath, testName, folderName);

            if (use == TestHelper.TestFolders.ActualOutput && !Directory.Exists(testFolderPath))
            {
                Directory.CreateDirectory(testFolderPath);
                while (!Directory.Exists(testFolderPath))
                {
                    System.Threading.Thread.Sleep(50);
                }
            }

            Assert.IsTrue(Directory.Exists(testFolderPath), $"Was unable to find directory {testFolderPath}");
            return(testFolderPath);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the path of the folder used by the test.
        /// </summary>
        /// <param name="testName">The name of test currently runnig that will used created path.</param>
        /// <param name="use">Whether the path is for Input, Expected Output or ActualOutput.</param>
        /// <param name="isLanguageSpecific">Indicate whether there is subfolder called CSharp.</param>
        /// <returns></returns>
        private static string GetTestFolderPath(string testSubpath, string testName, TestHelper.TestFolders use, bool isLanguageSpecific = false)
        {
            string folderName = Enum.GetName(typeof(TestHelper.TestFolders), use);

            if (use == TestFolders.ActualOutput)
            {
                folderName = GetTestActualOutputFolderName();
            }

            string testFolderPath = isLanguageSpecific ? Path.Combine(TestDataPath, testSubpath, testName, folderName, "CSharp")
                : Path.Combine(TestDataPath, testSubpath, testName, folderName);

            if (use == TestHelper.TestFolders.ActualOutput && !Directory.Exists(testFolderPath))
            {
                Directory.CreateDirectory(testFolderPath);
                while (!Directory.Exists(testFolderPath))
                {
                    System.Threading.Thread.Sleep(50);
                }
            }

            //Assert.IsTrue(Directory.Exists(testFolderPath), $"Was unable to find directory {testFolderPath}");
            return(testFolderPath);
        }