public void Should_update_template_and_git_repo_to_current_state( IBuildConfigXmlClient buildConfigXmlClient, IBuildConfigClient buildConfigClient, IFixture fixture, string buildConfigId, string currentRepoPath) { var oldVersion = new BuildConfigXmlGenerator(buildConfigXmlClient, buildNonStubVersion: true) .WithId(buildConfigId) .WithTemplateId("CPlusPlusTemplate_v1") .Create(); var currentVersion = fixture.Build <BuildConfig>() .WithId(buildConfigId) .WithParameters(new Properties { Property = new PropertyList() { new Property(ParameterName.GitRepoPath, currentRepoPath), } }) .WithTemplates(new Templates { BuildType = new List <Template>() { new Template() { Id = "BaseTemplateV5GitLab" } } }) .Create(); oldVersion.SwitchTemplateAndRepoToCurrentState(currentVersion); Assert.Equal("BaseTemplateV5GitLab", oldVersion.Xml.SelectSingleNode("/build-type/settings").Attributes["ref"].Value); Assert.Equal(currentRepoPath, oldVersion.Xml.SelectSingleNode("/build-type/settings/parameters/param[@name='" + ParameterName.GitRepoPath + "']").Attributes["value"].Value); }
public BuildConfigChain(IBuildConfigClient buildConfigClient, BuildConfig rootBuildConfig) { _buildConfigClient = buildConfigClient; InitGraph(rootBuildConfig); }