Example #1
0
        public void GetBuildConfigurations_ByName()
        {
            // Arrange
            Action <IBuildConfigurationHavingBuilder> having = _ => _.Name("FluentTc");
            var teamCityCaller = CreateTeamCityCaller();

            A.CallTo(() =>
                     teamCityCaller.Get <BuildTypeWrapper>("/app/rest/buildTypes?locator=name:FluentTc"))
            .Returns(new BuildTypeWrapper {
                BuildType = new List <BuildConfiguration>(new[] { new BuildConfiguration {
                                                                      Id = "bt987"
                                                                  } })
            });

            var connectedTc = new RemoteTc().Connect(_ => _.AsGuest(), teamCityCaller);

            // Act
            var buildConfigurations = connectedTc.GetBuildConfigurations(having);

            // Assert
            buildConfigurations.Single().Id.Should().Be("bt987");
        }
Example #2
0
        public void GetBuildConfigurations_ByName()
        {
            // Arrange
            Action<IBuildConfigurationHavingBuilder> having = _ => _.Name("FluentTc");
            var teamCityCaller = CreateTeamCityCaller();
            A.CallTo(
                () =>
                    teamCityCaller.Get<BuildTypeWrapper>("/app/rest/buildTypes?locator=name:FluentTc"))
                .Returns(new BuildTypeWrapper { BuildType = new List<BuildConfiguration>(new[] { new BuildConfiguration { Id = "bt987" } }) });

            var connectedTc = new RemoteTc().Connect(_ => _.AsGuest(), teamCityCaller);

            // Act
            var buildConfigurations = connectedTc.GetBuildConfigurations(having);

            // Assert
            buildConfigurations.Single().Id.Should().Be("bt987");
        }