c# - Not getting test case results(passed/failed/blocked) from TestSuite using TFS API -


i trying test case results(passed/failed/blocked) testsuite under test plan.

using below code this.

  public list<scoreboard> getteststatistics(string teamproject, string selectedtestplan)     {         // 1. connect tfs , test managemenet service , test plans         string servername = "*********";         var server = new uri(servername);         var tfs = tfsteamprojectcollectionfactory         .getteamprojectcollection(server);         var service = tfs.getservice<itestmanagementservice>();         var testproject = service.getteamproject(teamproject);         var plan = testproject.testplans.query("select * testplan").where(tp => tp.name == selectedtestplan).firstordefault();         list<scoreboard> scoreboards = new list<scoreboard>();         var testsuits = new list<istatictestsuite>();         if (plan.rootsuite != null)         {             testsuits.addrange(testsuitehelper.gettestsuiterecursive(plan.rootsuite));         }         testplan testplan = new testplan() { id = plan.id, name = plan.name, testsuites = testsuits };          (int = 0; < testplan.testsuites.count; i++)         {             var ts = testplan.testsuites[i];             var scoreboard = new scoreboard();             scoreboard.teamproject = teamproject;             scoreboard.testplan = selectedtestplan;             scoreboard.id = ts.id;             scoreboard.title = ts.title;             scoreboard.state = ts.state.tostring();             scoreboard.testcasecount = ts.testcases.count;                int totalteststeps = 0;             list<string> teststepscores = new list<string>();             foreach (var tc in ts.testcases)             {                 foreach (var in tc.testcase.actions)                 {                     totalteststeps = totalteststeps + 1;                 }                                  var testresults = testproject.testresults.bytestid(tc.testcase.testsuiteentry.id);                 foreach (var result in testresults)                 {                       (int actionindex = 0; actionindex < tc.testcase.actions.count; actionindex++)                     {                         var action = tc.testcase.actions[actionindex];                         if (!(action iteststep))                         {                             continue;                         }                         var step = action iteststep;                         var topiteration = result.iterations.firstordefault();                         if (topiteration == null)                             continue;                          var test = topiteration.actions[actionindex];                         teststepscores.add(topiteration.actions[actionindex].outcome.tostring());                     }                 }             }               scoreboard.teststepcount = totalteststeps;             scoreboard.teststeppassedcount = teststepscores.where(tsp => tsp == "passed").tolist().count;             scoreboard.teststepfailedcount = teststepscores.where(tsp => tsp == "failed").tolist().count;             scoreboard.teststepoutstandingcount = teststepscores.where(tsp => tsp == "none").tolist().count;             scoreboards.add(scoreboard);         }         return scoreboards;     } 

i not getting correct result passed test/failed/outstanding test count. when debugged this, observed property showing message "function evaluation disabled because previous function evaluation timed out. must continue execution reenable function evaluation." can how many test cases passed under test suite ? problem here?


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -