示例#1
0
        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);
        }
示例#2
0
        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);
        }