public void SaveEmployer_updates_timestamp() { // //Arrange _repo = new Mock <IEmployerRepository>(); _uow = new Mock <IUnitOfWork>(); _woServ = new Mock <IWorkOrderService>(); _map = new Mock <IMapper>(); var _e = (Employer)Records.employer.Clone(); string user = "******"; _e.datecreated = DateTime.MinValue; _e.dateupdated = DateTime.MinValue; var _serv = new EmployerService(_repo.Object, _woServ.Object, _uow.Object, _map.Object); // //Act _serv.Save(_e, user); // //Assert Assert.IsTrue(_e.updatedby == user); Assert.IsTrue(_e.dateupdated > DateTime.MinValue); }
public void EmployerService_SaveEmployer_updates_timestamp() { // //Arrange _repo = new Mock<IEmployerRepository>(); _uow = new Mock<IUnitOfWork>(); _woServ = new Mock<IWorkOrderService>(); var _e = (Employer)Records.employer.Clone(); string user = "******"; _e.datecreated = DateTime.MinValue; _e.dateupdated = DateTime.MinValue; var _serv = new EmployerService(_repo.Object, _woServ.Object, _uow.Object); // //Act _serv.Save(_e, user); // //Assert Assert.IsTrue(_e.Updatedby == user); Assert.IsTrue(_e.dateupdated > DateTime.MinValue); }