public void Edit_Trip_returns_Correct_Trip()
 {
     TripController controller = new TripController(repository, provider);
     ViewResult result = controller.Edit(userTrip.TripID) as ViewResult;
     Trip model = result.Model as Trip;
     Assert.AreEqual(model, userTrip);
 }
 public void Edit_edits_correct_Trip()
 {
     TripController controller = new TripController(repository, provider);
     userTrip.description = "My editted trip";
     userTrip.destination = "No where";
     controller.Edit(userTrip);
     ViewResult result =  controller.Index() as ViewResult;
     IQueryable<Trip> model = result.Model as IQueryable<Trip>;
     Assert.AreEqual(1, model.Count());
     Assert.IsTrue(model.Contains(userTrip));
 }
 public void Cannot_edit_other_users_trips()
 {
     TripController controller = new TripController(notUserRepository, provider);
     ViewResult result = controller.Edit(notUserTrip.TripID) as ViewResult;
     Trip model = result.Model as Trip;
 }
 public void Cannot_Edit_Post_changes_to_other_users_trips()
 {
     TripController controller = new TripController(notUserRepository, provider);
     notUserTrip.description = "Editted Trip";
     controller.Edit(notUserTrip);
     ViewResult result = controller.Index() as ViewResult;
     IQueryable<Trip> model = result.Model as IQueryable<Trip>;
 }
 public void Cannot_Edit_nonexistent_Trip()
 {
     TripController controller = new TripController(repository, provider);
     ViewResult result = controller.Edit(Guid.NewGuid()) as ViewResult;
     Trip model = result.Model as Trip;
 }