示例#1
0
        private void InitializeTestAgentConfigFromXElement(XElement config)
        {
            this.Name = config.Element("name").Value;

            switch (config.Element("type").Value.ToLower())
            {
                case "tobecreated":
                    this.DeploymentType = EnvironmentDeploymentType.ToBeCreated;
                    break;
                case "existing":
                    this.DeploymentType = EnvironmentDeploymentType.Existing;
                    break;
                default:
                    this.DeploymentType = EnvironmentDeploymentType.Undefined;
                    break;
            }

            this.TestAgentDomainConfig = new DomainConfig(config.Element("domain"));

            this.Categories = new List<string>();
            foreach (string c in config.Element("categories").Value.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
            {
                this.Categories.Add(c.Trim());
            }

            this.Machines = new List<Machine>();
            foreach (XElement machine in config.Element("machines").Elements("machine"))
            {
                this.Machines.Add(new Machine(machine));
            }
        }
示例#2
0
        private void InitializeFromXElement(XElement config)
        {
            this.Name = config.Element("name").Value;

            switch (config.Element("type").Value.ToLower())
            {
                case "tobecreated":
                    this.DeploymentType = EnvironmentDeploymentType.ToBeCreated;
                    break;
                case "existing":
                    this.DeploymentType = EnvironmentDeploymentType.Existing;
                    break;
                default:
                    this.DeploymentType = EnvironmentDeploymentType.Undefined;
                    break;
            }

            this.SUTDomainConfig = new DomainConfig(config.Element("domain"));

            this.Machines = new List<Machine>();
            foreach (XElement machine in config.Element("machines").Elements("machine"))
            {
                this.Machines.Add(new Machine(machine));
            }
        }