Esempio n. 1
0
        public void WhenTheUserCreatesANewBooking()
        {
            BookingDataGenerator bookingDataGenerator = new BookingDataGenerator();
            Booking bookingData = bookingDataGenerator.Generate();

            bookingPage.CreateBooking(bookingData);

            ScenarioContext.Current["BookingData"] = bookingData;
        }
Esempio n. 2
0
        public void GivenIEnterDataForTheFollowingFields(string firstName, string lastname, string price, string deposit, string startDate, string endDate)
        {
            //retrieving number of rows on the page so that we can compare that later on to find
            // whether a row has been added or not
            int CurrentRowCount = _bookingPage.GetCurrentRowsOnPage();

            //Generating a random number to create a unique record
            Random random = new Random();

            var NewBooking = new BookingRecord
            {
                FirstName = firstName,
                Surname   = "surname" + random.Next(10, 1000),
                Price     = price,
                Deposit   = deposit,
                CheckIn   = startDate,
                CheckOut  = endDate,
            };

            _bookingPage.CreateBooking(NewBooking);

            _bookingPage.WaitUntilRowHasBeenAdded(CurrentRowCount);

            FeatureContext.Current[NewlyCreatedBookingRecord] = NewBooking;
        }
 public void Can_Create_a_Booking()
 {
     //Go to Bookings Page,get the bookings count and store
     BookingPage.GoTo();
     BookingPage.StoreCount();
     //create a new booking and save
     BookingPage.CreateBooking("TestFN", "TestSN")
     .WithDetails("152.23", "true", "2018-11-07", "2018-11-09")
     .Save();
     //Go to Bookings Page,get the new bookings count (should be greater)
     BookingPage.GoTo();
     Assert.AreEqual(BookingPage.PreviousBookingsCount + 1, BookingPage.CurrentBookingsCount, "Count of bookings did not increase");
 }
Esempio n. 4
0
        public static void CreateBooking()
        {
            BookingPage.GoTo();
            FirstName = "TestWFFN";
            SurName   = "TestWFSN";
            Price     = "235.67";
            Deposit   = "true";
            CheckIn   = "2018-11-10";
            CheckOut  = "2018-11-15";

            BookingPage.CreateBooking(FirstName, SurName)
            .WithDetails(Price, Deposit, CheckIn, CheckOut)
            .Save();
        }