Exemplo n.º 1
0
        public void CheckinTo10X10_first()
        {
            // Arrange
            var resolver = new InterfaceResolver();
            resolver.Register<IRoomAccess, RoomAccess>();
            var roomAccess = resolver.Resolve<IRoomAccess>();

            roomAccess.GenerateBasicHotel(10, 10, 1);

            IReservingEngine service = new ReservingEngine(resolver);

            var newGuest = new Guest(fname: "New", lname: "Guest");

            // Act
            Room x = service.PerformAutoCheckin(newGuest);

            // Assert
            Assert.AreEqual("1,1,1", x.Location.ToString());
        }
Exemplo n.º 2
0
        public void PerformCheckinToFullHotel()
        {
            // Arrange
            var resolver = new InterfaceResolver();
            resolver.Register<IRoomAccess, RoomAccess>();
            var roomAccess = resolver.Resolve<IRoomAccess>();

            roomAccess.GenerateBasicHotel(1, 2, 1);

            var guest1 = new Guest(fname: "Some", lname: "Body");
            string roomNumber1 = roomAccess.GetRoomNumbers()[0];
            roomAccess.AssignGuestToRoom(guest1, roomNumber1);

            var guest2 = new Guest(fname: "Noone", lname: "Special");
            string roomNumber2 = roomAccess.GetRoomNumbers()[1];
            roomAccess.AssignGuestToRoom(guest2, roomNumber2);

            IReservingEngine service = new ReservingEngine(resolver);

            var newGuest = new Guest(fname: "New", lname: "Guest");

            // Act
            Room x = service.PerformAutoCheckin(newGuest);

            // Assert
            Assert.Fail("Expected Exception was not thrown");
        }
Exemplo n.º 3
0
        public void InstantiateReservingServiceClassWithResolver()
        {
            // Arrange
            var resolver = new InterfaceResolver();

            // Act
            IReservingEngine service = new ReservingEngine(resolver);

            // Assert
            Assert.IsNotNull(service);
        }
Exemplo n.º 4
0
        public void PerformCheckin()
        {
            // Arrange
            var resolver = new InterfaceResolver();
            resolver.Register<IRoomAccess, RoomAccess>();
            var roomAccess = resolver.Resolve<IRoomAccess>();

            roomAccess.GenerateBasicHotel(8, 2, 4);

            var guest1 = new Guest(fname: "Some", lname: "Body");
            string roomNumber1 = roomAccess.GetRoomNumbers()[4];
            roomAccess.AssignGuestToRoom(guest1, roomNumber1);

            var guest2 = new Guest(fname: "Noone", lname: "Special");
            string roomNumber2 = roomAccess.GetRoomNumbers()[3];
            roomAccess.AssignGuestToRoom(guest2, roomNumber2);

            IReservingEngine service = new ReservingEngine(resolver);

            var newGuest = new Guest(fname: "New", lname: "Guest");

            // Act
            Room x = service.PerformAutoCheckin(newGuest);

            // Assert
            Assert.AreEqual("8,1,1", x.Location.ToString());
        }
Exemplo n.º 5
0
        public void InstantiateReservingServiceClass()
        {
            // Arrange

            // Act
            IReservingEngine service = new ReservingEngine();

            // Assert
            Assert.IsNotNull(service);
        }