Ejemplo n.º 1
0
        public async Task <ActionResult> TestDetails(Guid testGuid)
        {
            TestCaseRepository testCaseRepo = new TestCaseRepository();
            var testCaseTask = testCaseRepo.GetByIdAsync(testGuid);

            ApplicationUserRepository <Tester> userRepo = new ApplicationUserRepository <Tester>();
            var testerTask = userRepo.GetByUserNameAsync(User.Identity.Name);

            TestsRepository testsRepo = new TestsRepository();

            ViewBag.Takened   = testsRepo.GetTestStatus(await testCaseTask, await testerTask);
            ViewBag.TestsGuid = testsRepo.GetByTestCaseForTester(await testerTask, await testCaseTask);
            return(View(await testCaseTask));
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> ResolveTest(Guid testGuid)
        {
            TestCaseRepository testCaseRepo = new TestCaseRepository();
            var testCaseTask = testCaseRepo.GetByIdAsync(testGuid);

            ApplicationUserRepository <Tester> userRepo = new ApplicationUserRepository <Tester>();
            var testerTask = userRepo.GetByUserNameAsync(User.Identity.Name);

            TestsRepository testsRepo = new TestsRepository();
            var             testsTask = testsRepo.GetByTestCaseForTesterAsync(await testerTask, await testCaseTask);

            TestStatusRepository testStatusRepo = new TestStatusRepository();

            ViewBag.TestStatus = testStatusRepo.GetAll();

            return(View(await testsTask));
        }
Ejemplo n.º 3
0
        public async Task TakeTest(Guid testGuid)
        {
            TestCaseRepository testCaseRepo = new TestCaseRepository();
            var testCaseTask = testCaseRepo.GetByIdAsync(testGuid);

            ApplicationUserRepository <Tester> userRepo = new ApplicationUserRepository <Tester>();
            var testerTask = userRepo.GetByUserNameAsync(User.Identity.Name);

            DataAccess.Model.Tests.Tests tests = new DataAccess.Model.Tests.Tests();
            tests.Test    = await testCaseTask;
            tests.Status  = TestsStatus.Takened;
            tests.Takened = DateTime.Now;
            tests.Tester  = await testerTask;

            TestsRepository testsRepo = new TestsRepository();

            testsRepo.Create(tests);
        }