public void Send_Email() { var newEvent = new Event { Id = 2, Subject = "test", Body = "body", Category = new Category { Id = 1 }, CreatedBy = new User { Id = 1, Email = "*****@*****.**" }, Date = DateTime.Today, From = DateTime.Now.AddHours(-1).TimeOfDay, To = DateTime.Now.AddHours(1).TimeOfDay, }; IUsersRepository userRepository = new FakeUserRepo(); var mailService = new MailService(userRepository); mailService.Send(EventStatus.Removed, newEvent); }
public void Remove_Event() { var eventIdToRemove = 2; var eventRepository = new EventRepository(); var userRepository = new FakeUserRepo(); var mailService = new MailService(userRepository); var eventController = new EventController(eventRepository, userRepository, mailService); eventController.RemoveEvent(eventIdToRemove); }