Beispiel #1
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);
        }
Beispiel #2
0
 public void Create_Event()
 {
     var repo = new EventRepository();
     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,
     };
     repo.Create(newEvent);
 }
Beispiel #3
0
 public void EventRepo_Range()
 {
     var eventRepository = new EventRepository();
     var events = eventRepository.Get(DateTime.Now, PeriodType.Month);
     Assert.AreEqual(6, events.Count());
 }
Beispiel #4
0
 public void Remove_Event_Repo_Only()
 {
     var eventIdToRemove = 1;
     var eventRepository = new EventRepository();
     eventRepository.Remove(eventIdToRemove);
 }