public ActionResult Details(int id)
        {
            var db = new CandidateRepository(Properties.Settings.Default.ConStr);

            return(View(new DetailsViewModel {
                Candidate = db.GetCandidate(id)
            }));
        }
Example #2
0
        public IActionResult ViewCandidate(int candidateId)
        {
            CandidateRepository repo = new CandidateRepository(_connectionString);
            CandidateViewModel  vm   = new CandidateViewModel();

            vm.Candidate = repo.GetCandidate(candidateId);
            return(View(vm));
        }
Example #3
0
        public ActionResult Details(int id)
        {
            ViewBag.Page = PageType.Pending;
            var manager = new CandidateRepository(Properties.Settings.Default.ConStr);

            return(View(new CandidateViewModel {
                Candidate = manager.GetCandidate(id)
            }));
        }
Example #4
0
        public IActionResult Details(int id)
        {
            ViewBag.Page = PageType.Pending;
            var manager = new CandidateRepository(_connectionString);

            return(View(new CandidateViewModel {
                Candidate = manager.GetCandidate(id)
            }));
        }
        public void CanRetrieveACandidateById()
        {
            var dbCandidate = _context.Candidates
                              .Include(c => c.Assessments)
                              .First();
            var aptitudeAssessment  = dbCandidate.Assessments.First(a => a.AssessmentType == AssessmentType.Aptitude);
            var behaviourAssessment = dbCandidate.Assessments.First(a => a.AssessmentType == AssessmentType.Behaviour);

            var result = _repo.GetCandidate(dbCandidate.Id);

            Assert.AreEqual(dbCandidate.Id, result.Id);
            Assert.AreEqual(dbCandidate.Firstname, result.Firstname);
            Assert.AreEqual(dbCandidate.Lastname, result.Lastname);
            Assert.AreEqual(dbCandidate.RoleId, result.RoleId);
            Assert.AreEqual(aptitudeAssessment.SentOn, result.AptitudeAssessment.SentOn);
            Assert.AreEqual(aptitudeAssessment.CompletedOn, result.AptitudeAssessment.CompletedOn);
            Assert.AreEqual(aptitudeAssessment.TrainabilityIndex, result.AptitudeAssessment.TrainabilityIndex);
            Assert.AreEqual(behaviourAssessment.SentOn, result.BehaviourAssessment.SentOn);
            Assert.AreEqual(behaviourAssessment.CompletedOn, result.BehaviourAssessment.CompletedOn);
            Assert.AreEqual(behaviourAssessment.WorkingStrengths, result.BehaviourAssessment.WorkingStrengths);
        }
Example #6
0
        public Candidate GetCandidate(string emailAddress)
        {
            Candidate candidateToReturn = null;

            using (var candidateRepo = new CandidateRepository())
            {
                var candidate = candidateRepo.GetCandidate(emailAddress);

                candidateToReturn = Mapper.Map <Candidate>(candidate);
            }

            return(candidateToReturn);
        }
Example #7
0
        public void GetExams()
        {
            using (var examRepo = new ExamRepository())
                using (var candidateRepo = new CandidateRepository())
                {
                    var candidate = candidateRepo.GetCandidate("*****@*****.**");

                    Assert.IsNotNull(candidate);

                    var openExam = examRepo.GetLatestOpenExam(candidate.Id, true, true);

                    Assert.IsNotNull(openExam);
                }
        }
        public Candidate GetCandidate(CandidateViewModel vm)
        {
            var repo = new CandidateRepository(_connectionString);

            return(repo.GetCandidate(vm.CandidateId));
        }
        public Candidate GetCandidate(int id)
        {
            var repo = new CandidateRepository(_connectionString);

            return(repo.GetCandidate(id));
        }
Example #10
0
        public IActionResult ViewCandidate(int id)
        {
            var db = new CandidateRepository(_connectionString);

            return(View(db.GetCandidate(id)));
        }