public void InsertJobApplication() { //Arrange var jobApplication = new JobApplication { CompanyName = "Jobtaine", JobTitle = "Software Engineer", City = "Westminster", State = "CA", JobPostingURL = "jobtaine.com/jobapplication" }; //Act bool actual = jas.InsertJobApplication(jobApplication); //Assert Assert.IsTrue(actual); }
public ActionResult AddJobApplication(JobApplicationRequest request) { try { JobApplication newJobApp = new JobApplication(request.CompanyName, request.JobTitle, request.Description, request.Status, request.City, request.State, request.URLToJobPosting); var user = userAccountService.ReadUserFromDBUsingEmail(request.UserEmail.ToLower()); newJobApp.UserAccountId = user.UserAccountId; if (!jobAppService.InsertJobApplication(newJobApp)) { return(new StatusCodeResult(StatusCodes.Status500InternalServerError)); } else { return(new OkObjectResult(newJobApp)); } } catch (Exception e) { Console.WriteLine(e); return(new StatusCodeResult(StatusCodes.Status500InternalServerError)); } }