public void ParseFile_Valid_Test()
        {
            // Assign
            PageObjectParser parser = new PageObjectParser();
            FileInfo file = PageObjectParserMock.VALID_READ_pomlFileInfo;
            Pages expected = PageObjectParserMock.VALID_pomlFile;

            // Act
            Pages result = parser.ParseFile(file);

            // Assert
            Assert.AreEqual(expected.Name, result.Name);
            for (int i = 0; i < expected.ListOfPages.Count; i++)
            {
                Page expectedPage = expected.ListOfPages[i];
                Page resultPage = result.ListOfPages[i];

                Assert.AreEqual(expectedPage.Name, resultPage.Name);
                for (int j = 0; j < expectedPage.ListOfElements.Count; j++)
                {
                    PageElement expectedElement = expectedPage.ListOfElements[j];
                    PageElement resultElement = resultPage.ListOfElements[j];

                    Assert.AreEqual(expectedElement.Name, resultElement.Name);
                    Assert.AreEqual(expectedElement.Locator, resultElement.Locator);
                    Assert.AreEqual(expectedElement.Selector, resultElement.Selector);
                    Assert.AreEqual(expectedElement.Type, resultElement.Type);
                }
            }
        }
        private List<PageObjectFile> ParseDirectory(DirectoryInfo info, string group)
        {
            List<PageObjectFile> files = new List<PageObjectFile>();
            if (info.Exists)
            {
                AbstractPageObjectParser parser = new PageObjectParser();

                // Parse each file in current directory
                foreach (FileInfo file in info.GetFiles())
                {
                    Pages page = parser.ParseFile(file);

                    if (page != null)
                    {
                        // Filter by group name
                        if (group == null || page.Name == group)
                        {
                            files.Add(new PageObjectFile()
                            {
                                FileInfo = file,
                                Data = page
                            });
                        }
                    }
                }

                // Parse each subdirectory using recursion.
                foreach (DirectoryInfo subDirectory in info.GetDirectories())
                {
                    files.AddRange(ParseDirectory(subDirectory, group));
                }
            }

            return files;
        }
        public void SaveObject_Valid_Test()
        {
            // Assign
            PageObjectParser parser = new PageObjectParser();
            FileInfo file = PageObjectParserMock.VALID_SAVE_pomlFileInfo;
            Pages data = PageObjectParserMock.VALID_pomlFile;

            // Act
            bool result = parser.SaveObject(file, data);

            // Assert
            Assert.IsTrue(result);
            Assert.IsTrue(File.Exists(file.FullName));
        }