public ActionResult Create(TestRunVM testRunVM)
        {
            var testRun = new TestRun
            {
                Title = testRunVM.Title,
                Closed = testRunVM.Closed,
                TestPlanID = testRunVM.TestPlanID,
                TestPlan = db.TestPlans.Find(testRunVM.TestPlanID)
            };

            db.TestRuns.Add(testRun);
            db.SaveChanges();

            return RedirectToAction("Index", "TestRunsOnTestPlan", new { id = testRunVM.TestPlanID });
        }
        public ActionResult Edit(TestRunVM testRunVM)
        {
            var testRun = db.TestRuns.Find(testRunVM.TestRunID);

            if (testRun == null) return HttpNotFound();

            testRun.Title = testRunVM.Title;
            testRun.Closed = testRunVM.Closed;
            testRun.TestPlanID = testRunVM.TestPlanID;
            testRun.TestPlan = db.TestPlans.Find(testRunVM.TestPlanID);

            db.Entry(testRun).State = EntityState.Modified;
            db.SaveChanges();

            return RedirectToAction("Index", "ExecuteTestRun", new { id = testRun.TestRunID });
        }
        public ActionResult Edit(int id)
        {
            var testRun = db.TestRuns.Find(id);

            if (testRun == null) return HttpNotFound();

            var testRunVM = new TestRunVM
            {
                TestRunID = id,
                Title = testRun.Title,
                Closed = testRun.Closed,
                TestPlanID = testRun.TestPlanID,
            };

            return View(testRunVM);
        }
        public ActionResult Create(int id = 0)
        {
            var testRunVM = new TestRunVM { TestPlanID = id };

            return View("Create", testRunVM);
        }