Ejemplo n.º 1
0
        public void SetProjectParameters_GivenParameterWithRawType_ById()
        {
            // Arrange
            var teamCityCaller = CreateTeamCityCaller();

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

            // Act
            connectedTc.SetProjectParameters(_ => _.Id("ProjectId"), __ => __.Parameter("param1", "value1", t => t.AsSelectList(s => s.Value("item1"))));

            // Assert
            A.CallTo(
                () =>
                teamCityCaller.Put("{\"name\":\"param1\",\"value\":\"value1\",\"type\":{\"rawValue\":\"select data_1='item1' display='normal'\"}}",
                                   HttpContentTypes.ApplicationJson, "/app/rest/projects/id:ProjectId/parameters/param1", string.Empty))
            .MustHaveHappened(Repeated.Exactly.Once);
        }
Ejemplo n.º 2
0
        public void SetProjectParameters_ById()
        {
            // Arrange
            var teamCityCaller = CreateTeamCityCaller();

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

            // Act
            connectedTc.SetProjectParameters(_ => _.Id("ProjectId"), __ => __.Parameter("param1", "value1"));

            // Assert
            A.CallTo(
                () =>
                    teamCityCaller.Put("value1", HttpContentTypes.TextPlain, "/app/rest/projects/id:ProjectId/parameters/param1", string.Empty))
                        .MustHaveHappened(Repeated.Exactly.Once);
        }