public void NavigateTo_OfferType(OfferTypes OfferType) { if (OfferType == OfferTypes.ForSale) { Click_ForSaleTab(); } else if (OfferType == OfferTypes.ForRent) { Click_ForRentTab(); } else if (OfferType == OfferTypes.NewlyBuilt) { Click_NewlyBuiltTab(); } else if (OfferType == OfferTypes.Recreation) { Click_RecreatieTab(); } else if (OfferType == OfferTypes.Europe) { Click_EuropeTab(); } }
public ViewMonetaryMarketViewModel() { Info = new MonetaryInfoViewModel(); foreach (var currency in Persistent.Currencies.GetAll()) { Currencies.Add(new SelectListItem() { Value = currency.ID.ToString(), Text = currency.Symbol }); } foreach (MonetaryOfferTypeEnum offerType in Enum.GetValues(typeof(MonetaryOfferTypeEnum))) { OfferTypes.Add(new SelectListItem() { Text = offerType.ToString(), Value = ((int)offerType).ToString() }); } }
public JobMarketViewModel(int countryID, IEnumerable <Entities.Country> countries, CountryBestJobOffers bestJobs) { CountryID = countryID; foreach (var country in countries) { Countries.Add(new SelectListItem() { Value = country.ID.ToString(), Text = country.Entity.Name }); if (country.ID == CountryID) { MinMax = new JobMarketBestViewModel(country, bestJobs); } } foreach (WorkTypeEnum workType in Enum.GetValues(typeof(WorkTypeEnum))) { WorkTypes.Add(new SelectListItem() { Value = ((int)workType).ToString(), Text = workType.ToString(), Selected = (workType == WorkTypeEnum.Any) }); } foreach (JobOfferTypeEnum offerType in Enum.GetValues(typeof(JobOfferTypeEnum))) { OfferTypes.Add(new SelectListItem() { Text = offerType.ToString(), Value = ((int)offerType).ToString() }); } }
public void Enter_CustomMinPrice(string Price, OfferTypes OfferType) { //Enter Price EnterText_UsingJS(txt_MinPrice, Price, "Min Price text area", ElementValidation.Mandatory); }
public Offer[] GetOffers(OfferTypes offerType) { return offerRepository.GetList().Where(o => o.OfferType == offerType).ToArray(); }
public void Assert_ApartmentPriceMatchesSearchCriteria(string MinmumPrice, string MaximumPrice, OfferTypes Offer, ElementValidation validation) { int ResultInPrice = 0; if (Offer == OfferTypes.ForSale) { string ApartmentPriceText = ReturnElementText(span_ApartmentPrice).Trim(',', 'k', 'k', '.', '.', '€', ' ', ' '); ResultInPrice = int.Parse(ApartmentPriceText, NumberStyles.Currency); } else if (Offer == OfferTypes.ForRent) { ResultInPrice = int.Parse(ReturnElementText(span_ApartmentPrice).Trim('d', 'm', 'n', '/', '.', '€', ' ')); } int MinPrice = int.Parse(MinmumPrice.Trim('€', ','), NumberStyles.Currency); int MaxPrice = 0; if (MaximumPrice == "No limit") { Assert_Number_GreaterThanAnotherNumber(ResultInPrice, MinPrice, "Apartment Price", validation); } else { MaxPrice = int.Parse(MaximumPrice.Trim('€', ','), NumberStyles.Currency); Assert_Number_BetweenTwoNumbers(ResultInPrice, MinPrice, MaxPrice, "Apartment Price", validation); } }
public void Search_Tests(OfferTypes OfferType, string Address, string LocationRange, string MinPrice, string MaxPrice) { //Navigate to home page FundaHome_Page.Navigate_ToHomePage(); //Select Offer Tab FundaHome_Page.NavigateTo_OfferType(OfferType); Thread.Sleep(2000); //Select Country if search in Europe if (OfferType == OfferTypes.Europe) { FundaHome_Page.SelectFrom_CountriesList(Address); } else { //Enter Address FundaHome_Page.Enter_SearchText(Address); } //Select Location Range if (OfferType != OfferTypes.Europe) { FundaHome_Page.Select_LocationRange(LocationRange); } else { FundaHome_Page.Assert_LocationRangeList_NotDisplayed(ElementValidation.Mandatory); } //Select Minimum Price if (OfferType == OfferTypes.ForSale || OfferType == OfferTypes.ForRent) { FundaHome_Page.Select_MinimumPrice(MinPrice); } else { FundaHome_Page.Assert_MinimumPriceList_NotDisplayed(ElementValidation.Non_Mandatory_Till_EOT); } //Select Maximum Price if (OfferType == OfferTypes.ForSale || OfferType == OfferTypes.ForRent) { FundaHome_Page.Select_MaximumPrice(MaxPrice); } else { FundaHome_Page.Assert_MaximumPriceList_NotDisplayed(ElementValidation.Non_Mandatory_Till_EOT); } //Click Search FundaHome_Page.Click_Search(); Thread.Sleep(2000); //If the address should be selected from list, select the first option if (FundaHome_Page.Is_SuggestionMessage_Visible()) { FundaHome_Page.SelectFrom_AddressList(0); //Click Search again FundaHome_Page.Click_Search(); } //Assert the First Result Card's Address contains the address keyword SearchResult_Page.Assert_AddressContains_SearchAddress(Address, ElementValidation.Non_Mandatory_Till_EOT); //Assert the First Result Card's Minimum Price is between the entered minimum and max prices if (OfferType == OfferTypes.ForSale || OfferType == OfferTypes.ForRent) { SearchResult_Page.Assert_ApartmentPriceMatchesSearchCriteria(MinPrice, MaxPrice, OfferType, ElementValidation.Non_Mandatory_Till_EOT); } //End the test Test_Messages.End_Test(); }
private bool SaveOfferType(string offerType) { int value; if (!int.TryParse(offerType, out value)) { return false; } OfferType = (OfferTypes)value; return true; }
protected string GetOffersUrl(OfferTypes offerType) { return string.Format(OfferFormat, ResolveClientUrl("~/PublicPages/OffersList.aspx"), (int)offerType); }