public async Task <WeatherData> GetWeatherData(string key, GetBy getBy, string value, Days forecastOfDays) { var model = await GetData(apiUrl + RequestBuilder.PrepareRequest(MethodType.Forecast, key, getBy, value, forecastOfDays)); var data = AutoMapper.Mapper.Map <WeatherData>(model); return(data); }
public async Task <UserRosterAccess> GetRosterAccessAsync(GetBy getBy, string userId, string id) { return(getBy switch { GetBy.RosterId => await GetByRosterIdAsync(userId, id), GetBy.RaiderId => await GetByRaiderIdAsync(userId, id), _ => null, });
public static void VerifyCheckboxesChecked(GetBy getBy, bool check, params string[] ids) { Thread.Sleep(DelayForValidation); IWebDriver driver = Config.GetDriver(); foreach (string id in ids) { Assert.AreEqual(check, IsSelected(getBy(id)), id + " is expected to be " + (check ? "" : "not ") + "selected."); } }
public async Task <IEnumerable <Transaction> > GetTransactions(GetBy by, int id) { switch (by) { case GetBy.PART: return(await this._transactionRepository.GetEntityListAsync(e => e.PartInstance.PartId == id)); case GetBy.PARTINSTANCE: return(await this._transactionRepository.GetEntityListAsync(e => e.PartInstanceId == id)); default: return(null); } }
public BeginInvokeOC<Station> GetStationList(GetBy parameter, string value) { if (CachedStations == null) { CachedStations = new BeginInvokeOC<Station>(Dispatcher.CurrentDispatcher); } else { CachedStations.Clear(); } String streamURL; switch (parameter) { case GetBy.Search: streamURL = String.Format(URL + SEARCH_CMD, value); break; case GetBy.Genre: streamURL = String.Format(URL + GENRE_CMD, value); break; case GetBy.Default: streamURL = String.Format(URL + DEFAULT_CMD); break; default: throw new ArgumentOutOfRangeException("parameter"); } if (_backgroundThread != null && _backgroundThread.IsAlive) { shutdownThread = true; while (_backgroundThread.IsAlive) { Thread.Sleep(5); } } shutdownThread = false; Stream _stream = FeedStream.GetStream(streamURL); XmlTextReader reader = new XmlTextReader(_stream); CachedStations.Clear(); _backgroundThread = new Thread(Start) {Priority = ThreadPriority.BelowNormal}; _backgroundThread.Start(reader); return CachedStations; }
public static void CheckMulitpleCheckboxes(GetBy getBy, bool check, params string[] ids) { IWebDriver driver = Config.GetDriver(); foreach (string id in ids) { By by = getBy(id); IWebElement element = driver.FindElement(by); if (!element.Displayed) { Assert.Fail("Element is hidden - " + by); return; } if (element.Selected != check) { element.Click(); } } Sleep(); }
public static void CheckMulitpleCheckboxesInPages(By select, GetBy getBy, bool check, params string[] ids) { foreach (string id in ids) { By by = getBy(id); if (IsElementPresent(by)) { CheckCheckboxes(by, check); } if (IsElementPresent(select)) { List <string> pages = GetOptionsInSelect(select); foreach (string page in pages) { SelectDropDownByVisibleText(select, page); if (IsElementPresent(by)) { CheckCheckboxes(by, check); } } } } Sleep(); }
public static string PrepareQueryParameter(this GetBy getby, string value) { string queryParameter = ""; switch (getby) { case GetBy.CityName: queryParameter = ReqestFor.City(value); break; case GetBy.Zip: queryParameter = ReqestFor.Zip(value); break; case GetBy.PostCode: queryParameter = ReqestFor.PostCode(value); break; case GetBy.PostalCode: queryParameter = ReqestFor.PostalCode(value); break; case GetBy.Metar: queryParameter = ReqestFor.Metar(value); break; case GetBy.iata: queryParameter = ReqestFor.iata(value); break; case GetBy.IPAddress: queryParameter = ReqestFor.IPAddress(value); break; } return(queryParameter); }
private void GetStations(GetBy getBy, String value, ItemsControl listView) { try { BeginInvokeOC<Station> list = stationFeedService.GetStationList(getBy, value); if (listView.ItemsSource == null) { listView.ItemsSource = list; } } catch (WebException) { OfflineMessageBox(); } }
public static string PrepareRequest(MethodType methodType, string key, GetBy getBy, string value, Days ofDays) { return(string.Concat(methodType.GetParameters(), "?key=", key, "&", getBy.PrepareQueryParameter(value), "&", ofDays.PrepareDays())); }
public static string PrepareRequest(MethodType methodType, string key, GetBy getBy, string value, DateTime date) { return(string.Concat(methodType.GetParameters(), "?key=", key, "&", getBy.PrepareQueryParameter(value), "&", ReqestFor.Date(date))); }
public WeatherModel GetWeatherData(string key, GetBy getBy, string value) { return(GetData(APIURL + RequestBuilder.PrepareRequest(MethodType.Current, key, getBy, value))); }
public WeatherModel GetWeatherData(string key, GetBy getBy, string value, Days ForecastOfDays) { return(GetData(APIURL + RequestBuilder.PrepareRequest(MethodType.Forecast, key, getBy, value, ForecastOfDays))); }
public WeatherModel GetWeatherData( string key, GetBy getBy, string value, Days ForecastOfDays) { return GetData(APIURL +RequestBuilder.PrepareRequest(MethodType.Forecast, key, getBy, value, ForecastOfDays)); }
public static string PrepareRequest(MethodType methodType, string key, GetBy getBy, string value) { return string.Concat(methodType.GetParameters(), "?key=", key, "&", getBy.PrepareQueryParameter(value)); }
public Task <WeatherModel> GetWeatherData(string key, GetBy getBy, string value, DateTime date) { return(GetData(APIURL + RequestBuilder.PrepareRequest(MethodType.History, key, getBy, value, date))); }
public WeatherModel GetWeatherData(string key, GetBy getBy, string value ) { return GetData(APIURL + RequestBuilder.PrepareRequest(MethodType.Current, key, getBy, value)); }