コード例 #1
0
    private void AddStatisticsField(string name, int value)
    {
        StatisticsField field = Instantiate(m_field, m_statArea);

        field.SetName(name);
        field.SetValue(value.ToString());
        m_stats.Add(field);
    }
コード例 #2
0
    private void AddLeaderboardField(int number, string name, int value)
    {
        StatisticsField field = Instantiate(m_field, m_statArea);

        field.SetNumber(number);
        field.SetName(name);
        field.SetValue(value.ToString());
        m_stats.Add(field);
    }
コード例 #3
0
        public void it_returns_full_build_field_2()
        {
            var                            tempBuildConfig                = m_client.BuildConfigs.All().First();
            ItemsField                     itemsField                     = ItemsField.WithFields(item: true);
            BuildsField                    buildsField                    = BuildsField.WithFields();
            RelatedField                   relatedField                   = RelatedField.WithFields(builds: buildsField);
            RelatedIssuesField             relatedIssuesField             = RelatedIssuesField.WithFields(href: true);
            ArtifactDependenciesField      artifactDependenciesField      = ArtifactDependenciesField.WithFields();
            BuildArtifactDependenciesField buildArtifactDependenciesField = BuildArtifactDependenciesField.WithFields();
            BuildSnapshotDependenciesField buildSnapshotDependenciesField = BuildSnapshotDependenciesField.WithFields();
            DatasField                     datasField                     = DatasField.WithFields();
            StatisticsField                statisticsField                = StatisticsField.WithFields();
            EntriesField                   entriesField                   = EntriesField.WithFields();
            PropertiesField                propertiesField                = PropertiesField.WithFields();
            ArtifactsField                 artifactsField                 = ArtifactsField.WithFields(href: true);
            ProblemOccurrencesField        problemOccurrences             = ProblemOccurrencesField.WithFields();
            TestOccurrencesField           testOccurrencesField           = TestOccurrencesField.WithFields();
            AgentField                     agentField                     = AgentField.WithFields(id: true);
            CompatibleAgentsField          compatibleAgentsField          = CompatibleAgentsField.WithFields(agent: agentField, href: true);
            BuildField                     buildField1                    = BuildField.WithFields(id: true);
            BuildChangeField               buildChangeField               = BuildChangeField.WithFields(nextBuild: buildField1, prevBuild: buildField1);
            BuildChangesField              buildChangesField              = BuildChangesField.WithFields(buildChange: buildChangeField);
            RevisionField                  revisionField                  = RevisionField.WithFields(version: true);
            RevisionsField                 revisionsField                 = RevisionsField.WithFields();
            LastChangesField               lastChangesField               = LastChangesField.WithFields();
            ChangesField                   changesField                   = ChangesField.WithFields();
            TriggeredField                 triggeredField                 = TriggeredField.WithFields(type: true);
            ProgressInfoField              progressInfoField              = ProgressInfoField.WithFields(currentStageText: true);
            TagsField                      tagsField             = TagsField.WithFields();
            UserField                      userField             = UserField.WithFields(id: true);
            CommentField                   commentField          = CommentField.WithFields(text: true);
            BuildTypeField                 buildTypeField        = BuildTypeField.WithFields(id: true);
            BuildTypeWrapperField          buildTypeWrapperField = BuildTypeWrapperField.WithFields(buildType: buildTypeField);
            LinkField                      linkField             = LinkField.WithFields(type: true);
            LinksField                     linksField            = LinksField.WithFields(link: linkField);
            var                            buildField            = BuildField.WithFields(links: linksField, buildType: buildTypeField, comment: commentField,
                                                                                         tags: tagsField, pinInfo: commentField, user: userField, running_info: progressInfoField,
                                                                                         canceledInfo: commentField, triggered: triggeredField, lastChanges: lastChangesField, changes: changesField,
                                                                                         revisions: revisionsField, versionedSettingsRevision: revisionField,
                                                                                         artifactDependencyChanges: buildChangesField, agent: agentField, compatibleAgents: compatibleAgentsField,
                                                                                         testOccurrences: testOccurrencesField, problemOccurrences: problemOccurrences, artifacts: artifactsField,
                                                                                         properties: propertiesField, resultingProperties: propertiesField, attributes: entriesField,
                                                                                         statistics: statisticsField, metadata: datasField, snapshotDependencies: buildSnapshotDependenciesField,
                                                                                         artifactDependencies: buildArtifactDependenciesField, customArtifactDependencies: artifactDependenciesField,
                                                                                         statusChangeComment: commentField, relatedIssues: relatedIssuesField, replacementIds: itemsField,
                                                                                         related: relatedField);

            var tempBuild = m_client.Builds.LastBuildByBuildConfigId(tempBuildConfig.Id);
            var build     = m_client.Builds.GetFields(buildField.ToString()).ById(tempBuild.Id);

            Assert.IsNotNull(build);
        }
コード例 #4
0
        public void it_returns_full_build_field_statistics_without_build()
        {
            var             tempBuildConfig = m_client.BuildConfigs.All().First();
            var             tempBuild       = m_client.Builds.LastBuildByBuildConfigId(tempBuildConfig.Id);
            PropertyField   propertyField   = PropertyField.WithFields(name: true, value: true);
            StatisticsField statisticsField = StatisticsField.WithFields(propertyField: propertyField, href: true, count: true);
            var             stats           = m_client.Statistics.GetFields(statisticsField.ToString()).GetByBuildId(tempBuild.Id);

            // By default teamcity return href null
            Assert.IsNull(stats.Href);
            Assert.IsNotNull(stats.Count);
            Assert.IsNotNull(stats.Property);
        }
コード例 #5
0
        public void it_returns_full_build_field_statistics_with_build()
        {
            var             tempBuildConfig = m_client.BuildConfigs.All().First();
            PropertyField   propertyField   = PropertyField.WithFields(name: true, value: true);
            StatisticsField statisticsField = StatisticsField.WithFields(propertyField: propertyField, href: true, count: true);
            BuildField      buildField      = BuildField.WithFields(statistics: statisticsField);
            var             tempBuild       = m_client.Builds.LastBuildByBuildConfigId(tempBuildConfig.Id);
            var             build           = m_client.Builds.GetFields(buildField.ToString()).ById(tempBuild.Id);

            Assert.IsNotNull(build.Statistics.Href);
            Assert.IsNotNull(build.Statistics.Count);
            Assert.IsNotNull(build.Statistics.Property);
        }
コード例 #6
0
        public void it_returns_first_build_types_builds_investigations_compatible_agents_field_null()

        {
            var tempBuildConfig = m_client.BuildConfigs.All().First();

            // Section 1
            var buildField = BuildField.WithFields(number: true, id: true);
            var tempBuild  = m_client.Builds.LastBuildByBuildConfigId(tempBuildConfig.Id);
            var build      = m_client.Builds.GetFields(buildField.ToString()).ById(tempBuild.Id);

            Assert.IsNull(build.Artifacts, "No Artifacts 1");
            Assert.IsNull(build.RelatedIssues, "No RelatedIssues 1");
            Assert.IsNull(build.Statistics, "No Statistics 1");

            // section 2
            var artifactsField     = ArtifactsField.WithFields();
            var relatedIssuesField = RelatedIssuesField.WithFields();
            var statisticsField    = StatisticsField.WithFields();

            buildField = BuildField.WithFields(id: true, artifacts: artifactsField, relatedIssues: relatedIssuesField,
                                               statistics: statisticsField);
            tempBuild = m_client.Builds.LastBuildByBuildConfigId(tempBuildConfig.Id);
            build     = m_client.Builds.GetFields(buildField.ToString()).ById(tempBuild.Id);
            Assert.IsNotNull(build.Artifacts, "No Artifacts 2");
            Assert.IsNotNull(build.Artifacts.Href, "No Artifacts href 2");
            Assert.IsNotNull(build.RelatedIssues, "No RelatedIssues 2");
            Assert.IsNotNull(build.RelatedIssues.Href, "No RelatedIssues href 2");
            Assert.IsNotNull(build.Statistics, "No Statistics 2");
            Assert.IsNull(build.Statistics.Href, "No Statistics href 2");

            // section 3
            statisticsField    = StatisticsField.WithFields(href: true);
            artifactsField     = ArtifactsField.WithFields(href: true);
            relatedIssuesField = RelatedIssuesField.WithFields(href: true);
            buildField         = BuildField.WithFields(id: true, artifacts: artifactsField, relatedIssues: relatedIssuesField,
                                                       statistics: statisticsField);
            tempBuild = m_client.Builds.LastBuildByBuildConfigId(tempBuildConfig.Id);
            build     = m_client.Builds.GetFields(buildField.ToString()).ById(tempBuild.Id);
            Assert.IsNotNull(build.Artifacts, "No Artifacts 3");
            Assert.IsNotNull(build.Artifacts.Href, "No Artifacts href 3");
            Assert.IsNotNull(build.RelatedIssues, "No RelatedIssues 3");
            Assert.IsNotNull(build.RelatedIssues.Href, "No RelatedIssues href 3");
            Assert.IsNotNull(build.Statistics, "No Statistics 3");
            Assert.IsNotNull(build.Statistics.Href, "No Statistics href 3");
        }