public TfsVersioncontrolShelvesetsChangesReponse ShelvesetsChanges(TfsVersionControlShelvesetsChangesArgs TfsVersionControlShelvesetsChangesArgs, IConfigurationRoot configuration) { string url = string.Format("{0}tfvc/shelvesets/{1};{2}/changes{3}", configuration["TfsApiUriChanges"], TfsVersionControlShelvesetsChangesArgs.Name, TfsVersionControlShelvesetsChangesArgs.Owner, (TfsVersionControlShelvesetsChangesArgs == null) ? String.Empty : TfsVersionControlShelvesetsChangesArgs.ToString()); return(TfsApiClient.QueryObject <TfsVersioncontrolShelvesetsChangesReponse>(url, configuration)); }
public TfsTestRunsResponse Runs(TfsTestRunsArgs TfsTestRunsArgs, IConfigurationRoot configuration) { string url = string.Format("{0}test/runs{1}", TfsApiClient.BaseAddress, (TfsTestRunsArgs == null) ? String.Empty : TfsTestRunsArgs.ToString()); return(TfsApiClient.QueryObject <TfsTestRunsResponse>(url, configuration)); }
public TfsWitWorkitemsResponse workItems(TfsWitWorkitemsArgs TfsWitWorkitemsArgs, IConfigurationRoot configuration) { string url = string.Format("{0}wit/workItems/{1}", configuration["TfsApiUriChanges"], TfsWitWorkitemsArgs.queryId, (TfsWitWorkitemsArgs == null) ? String.Empty : TfsWitWorkitemsArgs.ToString()); return(TfsApiClient.QueryObject <TfsWitWorkitemsResponse>(url, configuration)); }
public TfsVersionControlChangesetsResponse Changesets(TfsVensionControlChangesetsArgs TfsVensionControlChangesetsArgs, IConfigurationRoot configuration) { string url = string.Format("{0}tfvc/changesets{1}", TfsApiClient.BaseAddress, (TfsVensionControlChangesetsArgs == null) ? String.Empty : TfsVensionControlChangesetsArgs.ToString()); return(TfsApiClient.QueryObject <TfsVersionControlChangesetsResponse>(url, configuration)); }
public TfsWitWiqlResponse Wiql(TfsWitWiqlArgs TfsWitWiqlArgs, IConfigurationRoot configuration) { string url = string.Format("{0}wit/wiql/{1}{2}", TfsApiClient.BaseAddress, TfsWitWiqlArgs.queryId, (TfsWitWiqlArgs == null) ? String.Empty : TfsWitWiqlArgs.ToString()); return(TfsApiClient.QueryObject <TfsWitWiqlResponse>(url, configuration)); }
public TfsWitQueriesResponse Queries(TfsWitQueriesArgs TfsWitQueriesArgs, IConfigurationRoot configuration) { string url = string.Format("{0}wit/queries/{1}{2}", TfsApiClient.BaseAddress, configuration["PathToQuery"], (TfsWitQueriesArgs == null) ? String.Empty : TfsWitQueriesArgs.ToString()); return(TfsApiClient.QueryObject <TfsWitQueriesResponse>(url, configuration)); }
public List <TfsGetCommentsResponse> getComments(TfsGetCommentsArgs TfsGetCommentsArgs, IConfigurationRoot configuration) { string url = string.Format("{0}GetComments/{1}", configuration["UriGetComments"], TfsGetCommentsArgs.WorkItemId); return(TfsApiClient.QueryList <TfsGetCommentsResponse>(url, configuration)); }
public TfsBuildBuildsResponse builds(TfsBuildBuildsArgs TfsBuildBuildsArgs, IConfigurationRoot configuration) { string url = string.Format("{0}build/builds{1}", TfsApiClient.BaseAddress, (TfsBuildBuildsArgs == null) ? String.Empty : TfsBuildBuildsArgs.ToString()); return(TfsApiClient.QueryObject <TfsBuildBuildsResponse>(url, configuration)); }
public static void getTestResultsForBuildsFromTFS(IConfigurationRoot configuration) { try { TfsApiClient TfsApiClient = new TfsApiClient(configuration); // get definitions and their ID TfsBuildDefinitionsArgs TfsBuildDefinitionsArgs = new TfsBuildDefinitionsArgs(); TfsBuildDefinitionsArgs.apiVersion = "2.0"; TfsBuildDefinitionsArgs.type = new List <TFS.Api.Type>() { TFS.Api.Type.xaml, }; TfsBuildDefinitionsResponse TfsBuildDefinitionsResponse = TfsApiClient.Builds.Definitions(TfsBuildDefinitionsArgs, configuration); //Find the definition that corresponds to the build foreach (Build build in builds) { Definition Definition = TfsBuildDefinitionsResponse.BuildDefinitions.Find(x => x.Name == build.buildName); if (Definition != null) { // get builds for a definition string id = Definition.Id; TfsBuildBuildsArgs TfsBuildBuildsArgs = new TfsBuildBuildsArgs(); TfsBuildBuildsArgs.apiVersion = "2.0"; TfsBuildBuildsArgs.definitions = new List <string> { id, }; TfsBuildBuildsResponse TfsBuildBuildsResponse = TfsApiClient.Builds.builds(TfsBuildBuildsArgs, configuration); // get the Latest Sonar Build Element element = TfsBuildBuildsResponse.Elements.FirstOrDefault(x => x.BuildNumber.StartsWith("Sonar_") == true); if (element != null) { // get testResults for a build TfsTestRunsArgs TfsTestRunsArgs = new TfsTestRunsArgs(); TfsTestRunsArgs.apiVersion = "2.0"; TfsTestRunsArgs.BuildId = element.Id; TfsTestRunsResponse TfsTestRunsResponse = TfsApiClient.Test.Runs(TfsTestRunsArgs, configuration); if (TfsTestRunsResponse.TestResult.Count != 0) { //Fill test attributes of the build build.Totaltests = TfsTestRunsResponse.TestResult[0].Totaltests; build.PassedTests = TfsTestRunsResponse.TestResult[0].PassedTests; } else { build.Totaltests = "0"; build.PassedTests = "0"; } } } } } catch (Exception e) { string error = "Exception Occre while Inserting in table:" + e.Message + "\t" + e.GetType(); } }