コード例 #1
0
 private void AttachVcsToProject(CreateBuildConfigResponse buildConfigResponse, CreateVcsRootResponse vcsResponse)
 {
     TeamCityClient.AttachVcsEntries(
         TeamCityRequestBuilder.GetAttachVcsEntriesRequest(buildConfigResponse.Id, vcsResponse.Id));
 }
コード例 #2
0
 private void AttachVcsToProject(CreateBuildConfigResponse buildConfigResponse, CreateVcsRootResponse vcsResponse)
 {
     TeamCityClient.AttachVcsEntries(
         TeamCityRequestBuilder.GetAttachVcsEntriesRequest(buildConfigResponse.Id, vcsResponse.Id));
 }
コード例 #3
0
        public void CanCreateNewVcsRoot()
        {
            var proj = new CreateProject
            {
                Name = "TestProj123"
            };

            CreateProjectResponse projRes = null;

            try
            {
                projRes = Client.CreateProject(proj);
            }
            catch (Exception e)
            {
                Client.DeleteProject(new DeleteProject {
                    Locator = "name:TestProj123"
                });
                projRes = Client.CreateProject(proj);
            }

            var createVcs = new CreateVcsRoot
            {
                Name    = "TestVcs1",
                VcsName = "jetbrains.git",
                Project = new CreateVcsRootProject {
                    Id = projRes.Id
                },
                Properties = new CreateVcsRootProperties
                {
                    Properties = new List <CreateVcsRootProperty>
                    {
                        new CreateVcsRootProperty
                        {
                            Name  = "url",
                            Value = "https://github.com/ServiceStackApps/StackApis.git"
                        },
                        new CreateVcsRootProperty
                        {
                            Name  = "authMethod",
                            Value = "ANONYMOUS"
                        },
                        new CreateVcsRootProperty
                        {
                            Name  = "branch",
                            Value = "refs/heads/master"
                        }
                    }
                }
            };
            CreateVcsRootResponse response = null;

            try
            {
                response = Client.CreateVcsRoot(createVcs);
            }
            catch (Exception e)
            {
                Client.DeleteProject(new DeleteProject {
                    Locator = "id:" + projRes.Id
                });
                throw;
            }

            Assert.That(response, Is.Not.Null);
            Assert.That(response.Name, Is.EqualTo("TestVcs1"));
            Assert.That(response.Href, Is.Not.Null);
            Assert.That(response.Project, Is.Not.Null);
            Assert.That(response.Properties, Is.Not.Null);
            Assert.That(response.Properties.Count, Is.EqualTo(3));
            Assert.That(response.VcsRootInstances, Is.Not.Null);

            Client.DeleteProject(new DeleteProject {
                Locator = "id:" + projRes.Id
            });
        }