Example #1
0
        public void CanGetPageElementCollection()
        {
            //Setup
            var destFolderName = "PageObject";
            var destFolder     = Path.Combine(
                FileAndFolder.GetExecutionDirectory(),
                SolutionFolders.Resources.ToString(),
                SolutionFolders.Resources.ToString(),
                destFolderName
                );

            if (!Directory.Exists(destFolder))
            {
                Directory.CreateDirectory(destFolder);
            }


            var exePath  = FileAndFolder.GetProjectPath();
            var filePath = Path.Combine(exePath, "DevTests", SolutionFolders.Resources.ToString());

            FileAndFolder.CopyFile(FileName, filePath, FileName, destFolder);
            // instanciate
            var pageElement           = new PageElement();
            var folderStructure       = new string[] { SolutionFolders.Resources.ToString(), SolutionFolders.Resources.ToString(), destFolderName };
            var pageElementCollection = pageElement.GetPageElementsFromExccelFile(FileName, folderStructure);

            // Assert
            Assert.IsTrue(pageElementCollection.Count == 3);
            // Tear Down
            File.Delete(Path.Combine(destFolder, FileName));
            Directory.Delete(destFolder);
        }