public TestRunPartial testStoreMethod(int id, string testCaseTitle, string outcome)
        {
            TestRunPartial TestClass = new TestRunPartial();

            TestClass.id      = id.ToString();
            TestClass.name    = testCaseTitle;
            TestClass.outcome = outcome;
            return(TestClass);
        }
        public JsonResult TestRunFromTestCase(string testCaseId)
        {
            List <TestRunPartial> testrunStoreList = new List <TestRunPartial>();
            TestRunById           testrun          = new TestRunById();
            List <TestRunById>    testrunList      = new List <TestRunById>();
            List <TestRunById>    runStore;
            List <TestRunById>    RunList = new List <TestRunById>();
            //List<TestRunById> RundetailsList = new List<TestRunById>();
            TestRunProject testProData = logic.GetRunByProject();

            foreach (var test in testProData.value)
            {
                TestRunById runData = new 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(test1.id, test1.testCaseTitle, test1.outcome);
                    testrunStoreList.Add(store);
                }
            }
            return(Json(testrunStoreList, JsonRequestBehavior.AllowGet));
        }