Exemplo n.º 1
0
 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");
        }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 6
0
 public void WhenUserGetsHotelById(int id)
 {
     _hotel = HotelsApiCaller.GetHotelById(id);
 }
 public void ThenAllHotelInformationShouldBeReturned()
 {
     HotelsApiCaller.GetAllHotels();
 }
Exemplo n.º 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);
 }
Exemplo n.º 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));
 }
Exemplo n.º 11
0
 public void WhenUserCalssGetHotelByIDApi()
 {
     _hotelInfoById = HotelsApiCaller.GetHotelById(_id);
 }
 public void WhenUserCallsTheHotelApi()
 {
     hotels = HotelsApiCaller.GetHotels();
 }
Exemplo n.º 13
0
 public void WhenUserCallsGetHotelByIdApi()
 {
     addHotelResponse = HotelsApiCaller.GetHotelById(hotel.Id);
 }
Exemplo n.º 14
0
 public void GivenUserCallsAddHotelApi()
 {
     hotels = HotelsApiCaller.AddHotel(hotel);
 }
Exemplo n.º 15
0
 public void WhenTheUserCallsTheApiToCheckWeatherTheEnteriesArePresentOrNo_()
 {
     //ScenarioContext.Current.Pending();
     hotels = HotelsApiCaller.AddHotel(hotel);
 }
 public void WhenUserCallsAddHotelApi()
 {
     HotelsApiCaller.hotel_Id.Add(hotel.Id);
     hotels = HotelsApiCaller.AddHotel(hotel);
 }
Exemplo n.º 17
0
 public void WhenUserCallsGetHotelByIdWithApi(int hotelId)
 {
     hotel = HotelsApiCaller.GetHotelById(hotelId);
 }
Exemplo n.º 18
0
 public void WhenListOfHotel()
 {
     hotel = HotelsApiCaller.GetAllHotels();
 }
 public void WhenGetHotelByIdCall(int id)
 {
     hotel = HotelsApiCaller.GetHotelById(id);
 }
Exemplo n.º 20
0
 public void WhenUserEntersIdForGettingTheResultHotelAndCallsGetHotelById(int ID)
 {
     hotel = HotelsApiCaller.GetHotelById(ID);
 }
Exemplo n.º 21
0
 public void WhenUserCallsGetHotelByIDApi()
 {
     hotel = HotelsApiCaller.GetHotelByID(ID);
 }
Exemplo n.º 22
0
 public void WhenUserGetsAllHotelsByGetAllHotelsMethod()
 {
     HotelsApiCaller.GetAllHotels();
 }
Exemplo n.º 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));
 }
Exemplo n.º 27
0
 public void WhenUserCallsAddHotelApi()
 {
     _hotels = HotelsApiCaller.AddHotel(_hotel);
 }
Exemplo n.º 28
0
 public void GivenUserProvidesAValidIdForHotel(int id)
 {
     hotel = HotelsApiCaller.GetHotelsById(id);
 }
Exemplo n.º 29
0
 public void WhenUserCallsGetAllHotelsApi()
 {
     _hotels = HotelsApiCaller.GetAllHotels();
 }
 public void WhenUserSerchForAHotelById(int id)
 {
     hotels = HotelsApiCaller.GetAllHotels();
 }