Exemplo n.º 1
0
        public void TestViewRooms()
        {
            var sut = new GuestController();

            GuestController.Current      = new Reservation();
            GuestController.CurrentGuest = new Guest {
                PartySize = 2
            };
            GuestController.Current.Rooms = new List <Room>();
            Room r = new Room {
                RoomID = 13
            };
            var view   = sut.ViewRooms(r);
            var actual = GuestController.Current.Rooms[0].RoomID;
            //When
            var expected = 13;

            //Then
            Assert.NotNull(view);
            Assert.IsType <RedirectToActionResult>(view);
            Assert.True(expected == actual);
        }