public CandidateTest CreateCandidateTest(Candidate candidate) { CandidateTest candidateTest; try { FetchCandidateTest(candidate); throw new BusinessRuleException("Candidate already exists in the Test Instance"); } catch (RecordNotFoundException) { if (IsPractice) candidateTest = new PracticeTest(candidate); else candidateTest = new ActualTest(candidate); CandidateTests.Add(candidateTest); return candidateTest; } }
public PracticeTest(Candidate candidate) : base(candidate) { }
private void ChangeCandidateStatus(Candidate candidate, bool isActive) { if (candidate.HasPendingExams || candidate.HasInProgressExams) { throw new BusinessRuleException("Unable to deactivate candidate while it has a pending or in progress exam."); } candidate.Active = isActive; }
public CandidateTest FetchCandidateTest(Candidate candidate) { return FetchCandidateTest(candidate.Id); }
public void DeleteCandidate(Action action, Candidate candidate) { ThrowBusinessRuleViolationForCandidate(candidate); action(); }
public void ThrowBusinessRuleViolationForCandidate(Candidate candidate) { if (candidate.HadTakenExam) throw new BusinessRuleException("Candidate is already in the Candidate Test. Cannot be modified."); }
public Candidate CreateCandidate(string studentNumber) { try { FetchCandidate(studentNumber); throw new BusinessRuleException("Candidate already exists"); } catch (RecordNotFoundException) { var result = new Candidate(studentNumber); People.Add(result); return result; } }
public ActualTest(Candidate candidate) : base(candidate) { }
private void deleteCandidate(Candidate candidate) { _context.People.Remove(candidate); }
public CandidateTest(Candidate candidate) : this() { Candidate = candidate; StateId = 1; //Set the state to be scheduled when a new object (instance) is first created }
public CandidateTest CreateCandidateTest(Guid instanceId, Candidate candidate) { return FetchTestInstance(instanceId).CreateCandidateTest(candidate); }