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)); }
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)); }
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); }