public void RepositoryHasNewData()
        {
            IMeetingRepository repository = new MockMeetingRepository();
            int initialCount = repository.GetAll().Count;

            Meeting meeting = new Meeting() { Title = "Meeting Title" };
            repository.Add(meeting);
            Assert.IsTrue(repository.GetAll().Count == initialCount + 1);
        }
 public Meeting Add(Meeting entity)
 {
     if (entity.Id == 0)
     {
         context.Meetings.Add(entity);
         context.SaveChanges();
     }
     return entity;
 }
 public ActionResult Delete(int id, Meeting meeting)
 {
     try
     {
         //When the user confirms delete handle the posted meeting delete.
         meetingRepository.Remove(id);
         return RedirectToAction("Index");
     }
     catch
     {
         return View(meeting);
     }
 }
 public ActionResult Create(Meeting meeting)
 {
     try
     {
         //Take tne new meeting which has been posted and save it.
         meetingRepository.Add(meeting);
         return RedirectToAction("Index");
     }
     catch
     {
         //If there is an exception return the form view.
         return View(meeting);
     }
 }
 public ActionResult Create(Meeting meeting)
 {
     if (ModelState.IsValid)
         {
             //Take tne new meeting which has been posted and save it.
             meetingRepository.Add(meeting);
             return RedirectToAction("Index");
         }
     else
         {
             //If there is an exception return the form view.
             return View(meeting);
         }
 }
 public Meeting Update(Meeting meeting)
 {
     Meeting dbMeeting = context.Meetings.Find(meeting.Id);
     if (dbMeeting != null)
     {
         dbMeeting.Title = meeting.Title;
         dbMeeting.Description = meeting.Description;
         dbMeeting.MeetingDate = meeting.MeetingDate;
         dbMeeting.MakeUpDate = meeting.MakeUpDate;
         dbMeeting.AttendeesExpectedCount = meeting.AttendeesExpectedCount;
         dbMeeting.AttendeesActualCount = meeting.AttendeesActualCount;
         dbMeeting.MeetingAdminEmailAddress = meeting.MeetingAdminEmailAddress;
         dbMeeting.ConfirmMeetingAdminEmailAddress = meeting.ConfirmMeetingAdminEmailAddress;
         context.SaveChanges();
     }
     return meeting;
 }
 // GET: Meetings/Create
 public ActionResult Create()
 {
     //Return the view which contains the form to enter a new meeting.
     var meeting = new Meeting();
     return View(meeting);
 }
 public ActionResult Edit(int id, Meeting meeting)
 {
     try
     {
         //Save the updated meeting which has been posted.
         meetingRepository.Update(meeting);
         return RedirectToAction("Index");
     }
     catch
     {
         return View(meeting);
     }
 }
 public ActionResult Edit(int id, Meeting meeting)
 {
     if (ModelState.IsValid)
     {
         try
         {
             //Save the updated meeting which has been posted.
             meetingRepository.Update(meeting);
             return RedirectToAction("Index");
         }
         catch
         {
             return View(meeting);
         }
     }
     else
     {
         //If there is a validation error return the form view.
         return View(meeting);
     }
 }
 public ActionResult EditModel(Meeting meeting)
 {
     //Return a view with a form containing the editable contents of the meeting ID Provided.
     meetingRepository.Update(meeting);
     return RedirectToAction("Index");
 }
 public ActionResult Edit(int id, Meeting meeting)
 {
     if (ModelState.IsValid)
     {
         //Save the updated meeting which has been posted.
         meetingRepository.Update(meeting);
         return RedirectToAction("Index");
     }
     else
     {
         return View(meeting);
     }
 }