示例#1
0
        public void Givendates_GetCheapestBestRatedHotel()
        {
            Customer customer = new Customer(CustomerType.REGULAR);

            Hotel BridgeWood = new Hotel(customer, 160, 60);
            Hotel RidgeWood  = new Hotel(customer, 220, 150);
            Hotel LakeWood   = new Hotel(customer, 110, 90);

            hotels.Add(BridgeWood);
            hotels.Add(RidgeWood);
            hotels.Add(LakeWood);

            hotels[0].setRatingForHotel(4);
            hotels[1].setRatingForHotel(5);
            hotels[2].setRatingForHotel(3);

            string[] dates = { "11-09-2020", "12-09-2020" };
            HotelReservationService reservation = new HotelReservationService();
            string output = reservation.getCheapestBestRatedHotel(customer, hotels, dates);

            Assert.AreEqual("Hotel: LakeWood, Rate: 200, Rating: 3", output);
        }
示例#2
0
        public void GivenWeekDayandWeekEnd_ReturnCheapestHotelRewardCustomer()
        {
            List <Hotel> RewardCustomersHotelList = new List <Hotel>();
            Customer     customer = new Customer(CustomerType.REWARD);

            Hotel BridgeWood = new Hotel(customer, 160, 60);
            Hotel RidgeWood  = new Hotel(customer, 220, 150);
            Hotel LakeWood   = new Hotel(customer, 110, 90);

            RewardCustomersHotelList.Add(BridgeWood);
            RewardCustomersHotelList.Add(RidgeWood);
            RewardCustomersHotelList.Add(LakeWood);

            RewardCustomersHotelList[0].setRatingForHotel(4);
            RewardCustomersHotelList[1].setRatingForHotel(5);
            RewardCustomersHotelList[2].setRatingForHotel(3);

            string[] dates = { "12-09-2020", "13-09-2020" };
            HotelReservationService reservation = new HotelReservationService();
            string output = reservation.getCheapestBestRatedHotel(customer, hotels, dates);

            Assert.AreEqual("Hotel: Ridgewood, Rate: 140, Rating: 5", output);
        }