public IActionResult SaveEmployeeInformation (string title, DateTime dateOfBirth, string firstName, string lastName, string gender, string email, long phone, string webAddress, string facebook, string instagram, string twitter, string address1, string address2) { var EmployeeInformation = new EmployeeInformation() { EmployeeId = new Guid(), FirstName = firstName, LastName = lastName, DateOfBirth = dateOfBirth, Gender = gender, Email = email, Phone = phone, WebAddress = webAddress, Facebook = facebook, Instagram = instagram, Twitter = twitter, Address1 = address1, Address2 = address2 }; var employeeDataSaver = new EmployeeDataRepository(); employeeDataSaver.Save(EmployeeInformation); return(RedirectToAction("Index")); }
public IActionResult AllEmployees() { var employeeDataSaver = new EmployeeDataRepository(); var allEmployees = employeeDataSaver.GetEmployeeInformation(); return(View(allEmployees)); }
public void WhenRequestingAllEmployees_ReturnFriendlyExceptionMessageIfFileDoesnotExist() { var repo = new EmployeeDataRepository(); Assert.Throws <FileNotFoundException>(() => repo.GetEmployeeInformation()); }