Esempio n. 1
0
        public void ShouldReturnHotelRatingWhenPassed()
        {
            //// Creating object of place
            HotelFunctions miami = new HotelFunctions();
            //// Adding hotel and finding cheapest hotel
            List <Hotel> hotels = miami.AddHotel();
            ////Checking the rating
            int actual   = hotels[0].mrating;
            int expected = 3;

            Assert.AreEqual(expected, actual);
        }
Esempio n. 2
0
        public void ShouldReturnCheapestHotelWithBestRatingForRewardCustomer()
        {
            //// Creating object of place
            HotelFunctions miami = new HotelFunctions();

            //// Adding hotel and finding cheapest hotel
            miami.AddHotel(CustomerType.reward);
            DateTime[] dates  = new DateTime[] { Convert.ToDateTime("09/11/2020", cultureinfo), Convert.ToDateTime("09/12/2020", cultureinfo) };
            var        actual = miami.FindCheapestHotel(dates);
            ////Comparing the returned values
            string expected = "Ridgewood";

            Assert.AreEqual(expected, actual.mNameOfHotel);
        }
Esempio n. 3
0
        public void ShouldReturnCheapestHotel()
        {
            //// Creating object of place
            HotelFunctions miami = new HotelFunctions();

            //// Adding hotel and finding cheapest hotel
            miami.AddHotel();
            DateTime[] dates  = new DateTime[] { Convert.ToDateTime("11/09/2020"), Convert.ToDateTime("12/09/2020") };
            Hotel      actual = miami.FindCheapestHotelWithoutWeekend();
            ////Comparing the returned values
            Hotel expected = new Hotel("Lakewood");

            Assert.AreEqual(actual.mRegularWeekdayRate, expected.mRegularWeekdayRate);
        }
Esempio n. 4
0
        public void ShouldReturnHotelWithBestRating()
        {
            //// Creating object of place
            HotelFunctions miami = new HotelFunctions();

            //// Adding hotel and finding cheapest hotel
            miami.AddHotel();
            DateTime[] dates  = new DateTime[] { Convert.ToDateTime("11/09/2020"), Convert.ToDateTime("12/09/2020") };
            var        actual = miami.FindBestHotel(dates);
            ////Comparing the returned values
            Hotel expected = new Hotel("Ridgewood");

            Assert.AreEqual(actual.mNameOfHotel, expected.mNameOfHotel);
        }
Esempio n. 5
0
 public void ShouldReturnExptyExceptuonWhenCallingCheapestHotelFunction()
 {
     try
     {
         //// Creating object of place
         HotelFunctions miami = new HotelFunctions();
         //// Adding hotel and finding cheapest hotel
         miami.AddHotel();
         DateTime[] dates  = new DateTime[] { };
         Hotel      actual = miami.FindCheapestHotel(dates);
     }
     catch (HotelManagementCustomException e)
     {
         Assert.AreEqual("Date range cannot be empty", e.Message);
     }
 }
Esempio n. 6
0
        public void ShouldReturnCheapestHotelIncludingWeekend()
        {
            //// Creating object of place
            HotelFunctions miami = new HotelFunctions();

            //// Adding hotel and finding cheapest hotel
            miami.AddHotel();
            DateTime[] dates  = new DateTime[] { Convert.ToDateTime("11/09/2020", cultureinfo), Convert.ToDateTime("12/09/2020", cultureinfo) };
            Hotel      actual = miami.FindCheapestHotel(dates);
            ////Comparing the returned values
            List <Hotel> expected = new List <Hotel>()
            {
                new Hotel("Lakewood"), new Hotel("Bridgewood")
            };

            Assert.AreEqual(actual.mNameOfHotel, expected[0].mNameOfHotel);
        }