Exemple #1
0
        public async Task <ActionResult> GetPartialView(string name)
        {
            var testCases = await TestResultRepoApiHelper.GetTestCasesByName(name);

            var orderedTestCases = testCases.OrderByDescending(ts => ts.EndTime);

            return(PartialView("TestCaseCardList", orderedTestCases));
        }
        // GET: TestCase
        public async Task <ActionResult> Index(string id)
        {
            // Return the listview if no id is provided
            if (id == null)
            {
                //var testCases = await HelperMethods.TestResultRepoApiHelper.GetAllTestCases();
                //var groupedTestCases = getGroupedTestCases(testCases);
                var uniqueNames = await HelperMethods.TestResultRepoApiHelper.GetUniqueTestCaseNames();

                if (uniqueNames == null)
                {
                    ViewBag.Message = "No such TestCase found.";
                }

                return(View("TestCaseGroupList", uniqueNames));
            }

            // Return the index view if id is provided
            var testCase = await HelperMethods.TestResultRepoApiHelper.GetTestCase(id);

            if (testCase != null)
            {
                ViewBag.testCase     = testCase;
                ViewBag.TestCaseName = testCase.Name;

                var testcases = await TestResultRepoApiHelper.GetTestCasesByName(testCase.Name);

                var orderedTestCases = testcases.OrderByDescending(tc => tc.EndTime);

                ViewBag.testCases = orderedTestCases;
            }
            else
            {
                ViewBag.Message = "No such TestCase found.";
            }

            return(View());
            //return View("TestCaseCard", testCase);
        }