public IActionResult GetQualifiedCandidates(int JobId) { try { return(Ok(findCandidateService.GetQualifiedCandidates(JobId))); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public void VerifyQualifiedCandidates() { //act jobService.Setup(x => x.GetJobs()).ReturnsAsync(jobs); candidateService.Setup(x => x.GetCandidates()).ReturnsAsync(candidates); //assert var result = findCandidateService.GetQualifiedCandidates(4); //result shouldn't be empty Assert.NotEmpty(result); // There should be two qualified Candidates Assert.Equal(2, result.Count); // Test2 Candidate shouldn't exists cause Test2 skill doesn't match with Job Skill Assert.Null(result.Find(x => x.CandidateName == "Test2")); }