public void DeleteConfirmed() { IHotelkamerRepository hotelkamerRepository = new DummyHotekamerRepository(); HotelkamersController controller = new HotelkamersController(hotelkamerRepository); HotelkamerModel subject = hotelkamerRepository.Get(2); controller.DeleteConfirmed(2); Assert.IsTrue(!hotelkamerRepository.GetAll().Contains(subject)); }
public void EditPost() { IHotelkamerRepository hotelkamerRepository = new DummyHotekamerRepository(); HotelkamersController controller = new HotelkamersController(hotelkamerRepository); HotelkamerModel hot1 = hotelkamerRepository.Get(1); hot1.Type = "after update name"; hot1.Prijs = 35; controller.Edit(hot1); Assert.AreEqual(hot1, hotelkamerRepository.Get(1)); }
public void CreatePost() { IHotelkamerRepository hotelkamerRepository = new DummyHotekamerRepository(); HotelkamersController controller = new HotelkamersController(hotelkamerRepository); HotelkamerModel newhotelkamer = new HotelkamerModel() { Type = "testkamer" }; RedirectToRouteResult result = controller.Create(newhotelkamer) as RedirectToRouteResult; Assert.IsTrue(hotelkamerRepository.GetAll().Contains(newhotelkamer)); Assert.IsNotNull(result); }