public ActionResult TestRun(string testCaseId) { List <TestRunPartial> testrunStoreList = new List <TestRunPartial>(); List <TestRunById> testrunList = new List <TestRunById>(); TestRunById testrun = new TestRunById(); List <TestRunById> runStore; List <TestRunById> RunList = new List <TestRunById>(); TestRunProject testProData = logic.GetRunByProject(); foreach (var test in testProData.value) { TestRunById runData = logic.GetRunByRunId(test.id.ToString()); RunList.Add(runData); ListClass.RunList.Add(runData); } //project level run TestSuit dataretrive = new TestSuit(); runStore = new List <TestRunById>(); //TestCasesFromSuits testresult = logic.TestCaseFromSuit(plan.id.ToString(), inf.id.ToString); WorkItemsClass testresult = logic.testCaseMethod(testCaseId); //foreach (var test in testresult.fields) //{ foreach (var run in RunList) { foreach (var run1 in run.value) { if (run1.testCase.id.ToString() == testCaseId)//testresult.id.ToString()) { testrun = new TestRunById(); testrun = run; testrunList.Add(testrun); //int runid = Convert.ToInt32(run1.testRun.id); } } // } } foreach (var test in testrunList) { foreach (var test1 in test.value) { TestRunPartial store = testStoreMethod(Convert.ToInt32(test1.testRun.id), test1.testRun.name, test1.outcome); testrunStoreList.Add(store); } } return(PartialView("_TestRun", testrunStoreList)); }