Ejemplo n.º 1
0
        public BuildConfigXmlGenerator(IBuildConfigXmlClient buildConfigXmlClient = null, bool buildNonStubVersion = false)
        {
            _buildConfigXmlClient = buildConfigXmlClient;

            if (buildNonStubVersion)
            {
                BuildConfigXml = new BuildConfigXml(_buildConfigXmlClient, Guid.NewGuid().ToString(), Guid.NewGuid().ToString());
            }
            else
            {
                BuildConfigXml = Substitute.For <BuildConfigXml>(_buildConfigXmlClient, Guid.NewGuid().ToString(), Guid.NewGuid().ToString());
            }

            Xml.AppendChild(Xml.CreateXmlDeclaration("1.0", "UTF-8", null));

            BuildTypeElement = (XmlElement)Xml.AppendChild(Xml.CreateElement("build-type"));
            BuildTypeElement.SetAttribute("uuid", Guid.NewGuid().ToString());

            NameElement = (XmlElement)BuildTypeElement.AppendChild(Xml.CreateElement("name"));

            SettingsElement = (XmlElement)BuildTypeElement.AppendChild(Xml.CreateElement("settings"));
            SettingsElement.SetAttribute("ref", "CPlusPlusTemplate_v1");

            ParametersElement = (XmlElement)SettingsElement.AppendChild(Xml.CreateElement("parameters"));
        }
Ejemplo n.º 2
0
 public BuildConfigXmlGenerator WithTemplateId(string templateId)
 {
     SettingsElement = (XmlElement)BuildTypeElement.AppendChild(Xml.CreateElement("settings"));
     SettingsElement.SetAttribute("ref", templateId);
     return(this);
 }