コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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);
        }