/// <summary> /// TODO: temporary implementation /// </summary> public List <CommonDataItem <EngineType> > BuildCommonDataItems(IEnumerable <EngineType> data, string titleStrinFormat = "") { List <CommonDataItem <EngineType> > result = null; try { result = new List <CommonDataItem <EngineType> >(); data.ForEach(engineType => { CommonDataItem <EngineType> item = new CommonDataItem <EngineType>() { Data = engineType, Titile = engineType == EngineType.Gasoline ? "БЕНЗИН" : "ДИЗЕЛЬ" }; ((IPopupSelectionItem)item).Title = item.Titile; result.Add(item); }); } catch (Exception exc) { Crashes.TrackError(exc); Debugger.Break(); } return(result); }
/// <summary> /// TODO: temporary implementation /// </summary> public List <CommonDataItem <VehicleType> > BuildCommonDataItems(IEnumerable <VehicleType> data, string titleStrinFormat = "") { List <CommonDataItem <VehicleType> > result = null; try { result = new List <CommonDataItem <VehicleType> >(); data.ForEach(vehicleType => { CommonDataItem <VehicleType> item = new CommonDataItem <VehicleType>() { Data = vehicleType, Titile = vehicleType.ToString().ToUpper() }; ((IPopupSelectionItem)item).Title = item.Titile; result.Add(item); }); } catch (Exception exc) { Crashes.TrackError(exc); Debugger.Break(); } return(result); }
/// <summary> /// TODO: temporary implementation /// </summary> public List <CommonDataItem <Currency> > BuildCommonDataItems(IEnumerable <Currency> data, string titleStrinFormat = "") { List <CommonDataItem <Currency> > result = null; try { result = new List <CommonDataItem <Currency> >(); data.ForEach(currency => { CommonDataItem <Currency> item = new CommonDataItem <Currency>() { Data = currency, IconPath = currency == Currency.Euro ? EURO_CURRENCY_ICON_PATH : USD_CURRENCY_ICON_PATH, Titile = currency.ToString().ToUpper() }; ((IPopupSelectionItem)item).Title = item.Titile; result.Add(item); }); } catch (Exception exc) { Crashes.TrackError(exc); Debugger.Break(); } return(result); }
BrowserResponse WhenSendingCommonDataItemAsXml(CommonDataItem dataItem) { var browser = TestFactory.GetBrowserForTestDataModule(); var urn = UrlList.TestData_Root + "/" + _testRun.Id + UrlList.TestData_CommonData_forClient_relPath; return(browser.Post(urn, with => { with.XMLBody(dataItem); with.Accept("application/xml"); })); }
internal override void Execute() { var cmdlet = (SendTmxCommonDataItemCommand)Cmdlet; var keyValuePair = new CommonDataItem { Key = cmdlet.Key, Value = cmdlet.Value }; var commonDataSender = ProxyFactory.Get<CommonDataSender>(); try { commonDataSender.Send(keyValuePair); cmdlet.WriteObject(true); } catch (SendingCommonDataItemException e) { // throw new Exception("Failed to send data with key '" + cmdlet.Key + "'. " + e.Message); throw; } }
internal override void Execute() { var cmdlet = (SendTmxCommonDataItemCommand)Cmdlet; var keyValuePair = new CommonDataItem { Key = cmdlet.Key, Value = cmdlet.Value }; var commonDataSender = ProxyFactory.Get <CommonDataSender>(); try { commonDataSender.Send(keyValuePair); cmdlet.WriteObject(true); } catch (SendingCommonDataItemException e) { // throw new Exception("Failed to send data with key '" + cmdlet.Key + "'. " + e.Message); throw; } }
BrowserResponse WHEN_SendingCommonDataItem_as_Xml(CommonDataItem dataItem) { var browser = TestFactory.GetBrowserForTestDataModule(); var urn = UrlList.TestData_Root + "/" + _testRun.Id + UrlList.TestData_CommonData_forClient_relPath; return browser.Post(urn, with => { with.XMLBody<CommonDataItem>(dataItem); with.Accept("application/xml"); }); }