コード例 #1
0
 public void GivenDatabaseWith2JobApp_GetAllJobApplications__ReturnListOfTwoJobApplications()
 {
     _jobApplicationRepository.GetAll().Returns(new List <JobApplication>()
     {
         new JobApplicationBuilder().Build(), new JobApplicationBuilder().Build()
     });
     Assert.Equal(2, _jobApplicationService.GetJobApplications().Count());
 }
コード例 #2
0
 public ActionResult GetJobApplications(int startIndex, int numOfItemsToGet, string emailAddress)
 {
     try
     {
         var user = userAccountService.ReadUserFromDBUsingEmail(emailAddress.ToLower());
         if (user == null)
         {
             return(new NotFoundObjectResult("Email address not found"));
         }
         var jobApplications = jobAppService.GetJobApplications(user.UserAccountId, startIndex, numOfItemsToGet);
         return(new OkObjectResult(jobApplications));
     } catch {
         return(new StatusCodeResult(StatusCodes.Status500InternalServerError));
     }
 }