Exemplo n.º 1
0
        static Dictionary <string, GitApplication> ReadGitAppsList()
        {
            Dictionary <string, GitApplication> appDictionary = new Dictionary <string, GitApplication>();
            XmlDocument xml             = new XmlDocument();
            string      GitAppsListFile = "GitApps.xml";

            if (File.Exists(GitAppsListFile))
            {
                xml.Load(GitAppsListFile);

                XmlNodeList nodes = xml.SelectNodes("/GitApplications/GitApplication");
                foreach (XmlNode node in nodes)
                {
                    GitApplication app = new GitApplication()
                    {
                        AppName             = node.Attributes["Name"].Value,
                        FirstCommitID       = node.Attributes["FirstCommitID"].Value,
                        SecondCommitID      = node.Attributes["SecondCommitID"].Value,
                        GitUrl              = node.Attributes["GitUrl"].Value,
                        VerificationContent = node.Attributes["Content"].Value,
                        FileToModify        = node.Attributes["FileToModify"].Value,
                    };
                    appDictionary.Add(app.AppName, app);
                }
                return(appDictionary);
            }
            else
            {
                throw new ApplicationException("Test error:  The applications list file 'GitApps.xml' was not found. Unable to continue");
            }
        }
Exemplo n.º 2
0
        static Dictionary<string, GitApplication> ReadGitAppsList()
        {
            Dictionary<string, GitApplication> appDictionary = new Dictionary<string, GitApplication>();
            XmlDocument xml = new XmlDocument();
            string GitAppsListFile = "GitApps.xml";
            if (File.Exists(GitAppsListFile))
            {
                xml.Load(GitAppsListFile);

                XmlNodeList nodes = xml.SelectNodes("/GitApplications/GitApplication");
                foreach (XmlNode node in nodes)
                {
                    GitApplication app = new GitApplication()
                    {
                        AppName = node.Attributes["Name"].Value,
                        FirstCommitID = node.Attributes["FirstCommitID"].Value,
                        SecondCommitID = node.Attributes["SecondCommitID"].Value,
                        GitUrl = node.Attributes["GitUrl"].Value,
                        VerificationContent = node.Attributes["Content"].Value,
                        FileToModify = node.Attributes["FileToModify"].Value,
                    };
                    appDictionary.Add(app.AppName, app);
                }
                return appDictionary;
            }
            else
            {
                throw new ApplicationException("Test error:  The applications list file 'GitApps.xml' was not found. Unable to continue");
            }
        }