상속: IBuildIncludeBuilder
        public void GetColumns_IncludeStartDate_Formatted()
        {
            // Arrange
            var buildIncludeBuilder = new BuildIncludeBuilder();
            buildIncludeBuilder.IncludeStartDate();

            // Act
            var columns = buildIncludeBuilder.GetColumns();

            // Assert
            columns.Should().Be("buildTypeId,href,id,number,state,status,webUrl,startDate");
        }
예제 #2
0
        private BuildWrapper GetBuildWrapper(BuildHavingBuilder buildHavingBuilder, CountBuilder countBuilder,
            BuildIncludeBuilder buildIncludeBuilder)
        {
            var locator = buildHavingBuilder.GetLocator();
            var count = countBuilder.GetCount();
            var columns = buildIncludeBuilder.GetColumns();

            if (string.IsNullOrEmpty(count))
            {
                return m_Caller.GetFormat<BuildWrapper>("/app/rest/builds?locator={0},&fields=count,build({1})", locator,
                    columns);
            }

            return m_Caller.GetFormat<BuildWrapper>("/app/rest/builds?locator={0},{1},&fields=count,build({2})",
                locator, count, columns);
        }
예제 #3
0
        public List<Build> GetBuilds(Action<IBuildHavingBuilder> having, Action<CountBuilder> count, Action<BuildIncludeBuilder> include)
        {
            var buildHavingBuilder = m_BuildHavingBuilderFactory.CreateBuildHavingBuilder();
            having(buildHavingBuilder);
            var buildIncludeBuilder = new BuildIncludeBuilder();
            include(buildIncludeBuilder);
            var countBuilder = new CountBuilder();
            count(countBuilder);

            var locator = buildHavingBuilder.GetLocator();
            var parts = countBuilder.GetCount();
            var columns = buildIncludeBuilder.GetColumns();
            var buildWrapper = m_Caller.GetFormat<BuildWrapper>("/app/rest/builds?locator={0},count:{1},&fields=count,build({2})",
                locator, parts, columns);
            if (int.Parse(buildWrapper.Count) > 0)
            {
                return buildWrapper.Build;
            }
            return new List<Build>();
        }