public void WhenUserCallsAddHotelApi()
 {
     hotels = HotelsApiCaller.AddHotel(hotel);
     if (hotels != null)
     {
         ids.Add(hotels[0].id);
     }
 }
        public void GetHotelById()
        {
            List <Hotel> hotels = HotelsApiCaller.AddHotel(new Hotel()
            {
                Name         = "Hyatt Regency",
                Address      = "Viman Nagar, Pune",
                Id           = 100,
                LocationCode = "PNQ"
            });
            Hotel hotel = hotels.Find(h => h.Id == 100 && h.Name == "Hyatt Regency");

            hotel.Should().NotBeNull("The added hotel was not found in the list");
        }
 public void ThenVerifyIfAllHotelsArePresent()
 {
     hotels = HotelsApiCaller.GetAllHotels();
     foreach (Hotel obj in hotels)
     {
         foreach (int id in ids)
         {
             if (id == obj.id)
             {
                 count++;
             }
         }
     }
     count.Should().Equals(ids.Count);
 }
        public void GetListOfAllHotelsAdded()
        {
            List <Hotel> hotelsToAdd = new List <Hotel>()
            {
                new Hotel()
                {
                    Name         = "The Taj Mahal Hotel",
                    Address      = "Man Singh Road, New Delhi",
                    Id           = 101,
                    LocationCode = "DEL"
                },
                new Hotel()
                {
                    Name         = "The Oberoi",
                    Address      = "Nariman Point, Mumbai",
                    Id           = 102,
                    LocationCode = "BOM"
                },
                new Hotel()
                {
                    Name         = "JW Marriott Hotel",
                    Address      = "Sector 35, Chandigarh",
                    Id           = 103,
                    LocationCode = "IXC"
                }
            };
            List <Hotel> hotels = new List <Hotel>();

            foreach (Hotel hotel in hotelsToAdd)
            {
                hotels = HotelsApiCaller.AddHotel(hotel);
            }
            Hotel Delhi      = hotels.Find(h => h.Id == 101 && h.Name == "The Taj Mahal Hotel");
            Hotel Mumbai     = hotels.Find(h => h.Id == 102 && h.Name == "The Oberoi");
            Hotel Chandigarh = hotels.Find(h => h.Id == 103 && h.Name == "JW Marriott Hotel");

            Delhi.Should().NotBeNull("The Taj Mahal Hotel was not found in the list");
            Mumbai.Should().NotBeNull("The Oberoi was not found in the list");
            Chandigarh.Should().NotBeNull("JW Marriott Hotel was not found in the list");
        }
 public void WhenUserCallsAddHotelApi()
 {
     hotels = HotelsApiCaller.AddHotel(hotel);
     // hotels.Add(hotel);
 }
Beispiel #6
0
 public void WhenUserGetsHotelById(int id)
 {
     _hotel = HotelsApiCaller.GetHotelById(id);
 }
 public void ThenAllHotelInformationShouldBeReturned()
 {
     HotelsApiCaller.GetAllHotels();
 }
Beispiel #8
0
 public void WhenUserCallsGetHotelByIdApiById(int id)
 {
     hotel = HotelsApiCaller.GetHotelById(id);
 }
 public void WhenTheUserCallsTheHotelApi()
 {
     //ScenarioContext.Current.Pending();
     HotelsApiCaller.AddHotel(hotel);
     addHotelResponse = HotelsApiCaller.HotelById(hotel.Id);
 }
Beispiel #10
0
 public void ThenHotelWithMatchingIdShouldBeDisplayed(int Id)
 {
     hotel = HotelsApiCaller.GetHotelById(Id);
     hotel.Should().NotBeNull(string.Format("Hotel with id {0} not found in response", Id));
 }
Beispiel #11
0
 public void WhenUserCalssGetHotelByIDApi()
 {
     _hotelInfoById = HotelsApiCaller.GetHotelById(_id);
 }
 public void WhenUserCallsTheHotelApi()
 {
     hotels = HotelsApiCaller.GetHotels();
 }
Beispiel #13
0
 public void WhenUserCallsGetHotelByIdApi()
 {
     addHotelResponse = HotelsApiCaller.GetHotelById(hotel.Id);
 }
Beispiel #14
0
 public void GivenUserCallsAddHotelApi()
 {
     hotels = HotelsApiCaller.AddHotel(hotel);
 }
 public void WhenTheUserCallsTheApiToCheckWeatherTheEnteriesArePresentOrNo_()
 {
     //ScenarioContext.Current.Pending();
     hotels = HotelsApiCaller.AddHotel(hotel);
 }
 public void WhenUserCallsAddHotelApi()
 {
     HotelsApiCaller.hotel_Id.Add(hotel.Id);
     hotels = HotelsApiCaller.AddHotel(hotel);
 }
Beispiel #17
0
 public void WhenUserCallsGetHotelByIdWithApi(int hotelId)
 {
     hotel = HotelsApiCaller.GetHotelById(hotelId);
 }
Beispiel #18
0
 public void WhenListOfHotel()
 {
     hotel = HotelsApiCaller.GetAllHotels();
 }
 public void WhenGetHotelByIdCall(int id)
 {
     hotel = HotelsApiCaller.GetHotelById(id);
 }
 public void WhenUserEntersIdForGettingTheResultHotelAndCallsGetHotelById(int ID)
 {
     hotel = HotelsApiCaller.GetHotelById(ID);
 }
Beispiel #21
0
 public void WhenUserCallsGetHotelByIDApi()
 {
     hotel = HotelsApiCaller.GetHotelByID(ID);
 }
 public void WhenUserGetsAllHotelsByGetAllHotelsMethod()
 {
     HotelsApiCaller.GetAllHotels();
 }
Beispiel #23
0
 public void WhenUserCallsGetHotelByIdApi()
 {
     _hotel = HotelsApiCaller.GetHotelById(_hotelId);
 }
 public void ThenUserSeesTheListOfAllAvailableHotels()
 {
     _hotels = HotelsApiCaller.GetAllHotels();
 }
 public void WhenUserCallsAddHotelApi()
 {
     hotels = HotelsApiCaller.AddHotel(hotel);
     IdList.Add(hotel.Id);
 }
 public Hotel ThenUserSeesTheHotelWithTheGivenId(int id)
 {
     return(HotelsApiCaller.GetHotelById(id));
 }
Beispiel #27
0
 public void WhenUserCallsAddHotelApi()
 {
     _hotels = HotelsApiCaller.AddHotel(_hotel);
 }
Beispiel #28
0
 public void GivenUserProvidesAValidIdForHotel(int id)
 {
     hotel = HotelsApiCaller.GetHotelsById(id);
 }
Beispiel #29
0
 public void WhenUserCallsGetAllHotelsApi()
 {
     _hotels = HotelsApiCaller.GetAllHotels();
 }
 public void WhenUserSerchForAHotelById(int id)
 {
     hotels = HotelsApiCaller.GetAllHotels();
 }