IMakeAFlightAndHotelBookingGuestDetailsAuto IMakeAFlightAndHotelBookingGuestDetails.AutoFill() { this.guests.Last().Title = PaymentPageRnd.PickRandomGuestTitle(); this.guests.Last().FirstName = PaymentPageRnd.PickRandomGuestFirstName(); this.guests.Last().LastName = PaymentPageRnd.PickRandomGuestLastName(); this.guests.Last().DoB = PaymentPageRnd.PickRandomGuestDoB(GetGuestAge(this.guests.Count)); return(this); }
IMakeAFlightBookingGuestDetailsAuto IMakeAFlightBookingAllGuests.AutoFill() { int count = HomePage.Data.Rooms.Sum(i => i.Adults.GetValueOrDefault(0) + i.Children.GetValueOrDefault(0)); for (int index = 0; index < count; index++) { this.guests.Add(new Guest(index + 1) { Title = PaymentPageRnd.PickRandomGuestTitle() , FirstName = PaymentPageRnd.PickRandomGuestFirstName() , LastName = PaymentPageRnd.PickRandomGuestLastName() , DoB = PaymentPageRnd.PickRandomGuestDoB(GetGuestAge(this.guests.Count + 1)) }); } return(this); }