public void it_faces_exceptions_projectFeatures_field_when_unauthorized() { string projectId = "_Root"; string featureId = "PROJECT_EXT_1"; PropertyField propertyField = PropertyField.WithFields(name: true, value: true, inherited: true); PropertiesField propertiesField = PropertiesField.WithFields(propertyField: propertyField); ProjectFeatureField projectFeatureField = ProjectFeatureField.WithFields(type: true, properties: propertiesField); try { m_client.Projects.GetFields(projectFeatureField.ToString()) .GetProjectFeatureByProjectFeature(projectId, featureId); } catch (HttpException e) { Console.WriteLine(e); Assert.That(e.ResponseStatusCode == HttpStatusCode.Forbidden); } catch (Exception e) { Assert.Fail("GetFields faced an unexpected exception", e); } }
public void it_returns_full_build_field_resultingProperties() { var tempBuildConfig = m_client.BuildConfigs.All().First(); PropertyField propertyField = PropertyField.WithFields(name: true, value: true); PropertiesField propertiesField = PropertiesField.WithFields(propertyField: propertyField); var buildField = BuildField.WithFields(resultingProperties: propertiesField); var tempBuild = m_client.Builds.LastBuildByBuildConfigId(tempBuildConfig.Id); var build = m_client.Builds.GetFields(buildField.ToString()).ById(tempBuild.Id); Assert.IsNotNull(build); }
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); }
public void it_returns_projectFeatures_field() { string projectId = "_Root"; string featureId = "PROJECT_EXT_1"; PropertyField propertyField = PropertyField.WithFields(name: true, value: true, inherited: true); PropertiesField propertiesField = PropertiesField.WithFields(propertyField: propertyField); ProjectFeatureField projectFeatureField = ProjectFeatureField.WithFields(type: true, properties: propertiesField); ProjectFeature projectFeature = m_client.Projects.GetFields(projectFeatureField.ToString()).GetProjectFeatureByProjectFeature(projectId, featureId); Assert.That(projectFeature != null, "No project feature found for that specific project"); Assert.That(projectFeature.Type != null, "Bad Value type"); Assert.That(projectFeature.Properties != null, "Bad Value type"); Assert.That(projectFeature.Href == null, "Bad Value type"); Assert.That(projectFeature.Id == null, "Bad Value type"); }