Beispiel #1
0
        public void SetBuildConfigurationParameters_GivenParameterWithoutRawType_ConfigurationName()
        {
            // Arrange
            var teamCityCaller = A.Fake <TeamCityCaller>();

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

            // Act
            connectedTc.SetBuildConfigurationParameters(_ => _.Name("FluentTc"), p => p.Parameter("name", "newVal"));

            // Assert
            A.CallTo(
                () =>
                teamCityCaller.PutFormat("{\"name\":\"name\",\"value\":\"newVal\",\"type\":null}",
                                         HttpContentTypes.ApplicationJson, "/app/rest/buildTypes/{0}/parameters/{1}", A <object[]> .That.IsSameSequenceAs(new[] { "name:FluentTc", "name" })))
            .MustHaveHappened(Repeated.Exactly.Once);
        }
Beispiel #2
0
        public void SetBuildConfigurationParameters_ConfigurationName()
        {
            // Arrange
            var teamCityCaller = A.Fake<TeamCityCaller>();

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

            // Act
            connectedTc.SetBuildConfigurationParameters(_ => _.Name("FluentTc"), p=>p.Parameter("name","newVal"));

            // Assert
            A.CallTo(
                () =>
                    teamCityCaller.PutFormat("newVal", HttpContentTypes.TextPlain, "/app/rest/buildTypes/{0}/parameters/{1}", A<object[]>.That.IsSameSequenceAs(new[] {"name:FluentTc", "name"})))
                        .MustHaveHappened(Repeated.Exactly.Once);
        }