コード例 #1
0
        public override List <Market> GetData()
        {
            DataSet ds = new DataSet();

            ds.Locale = CultureInfo.CurrentCulture;
            ds.ReadXml(GetDataFilePath());
            DataRow dr = null;

            List <Market> market = new List <Market>();

            for (int i = 0; i < ds.Tables[1].Rows.Count; i++)
            {
                dr = ds.Tables[1].Rows[i];
                market.Add(
                    new Market(
                        dr[TestDataInfrastructure.GetTestInputData("TickerSymbol")].ToString(),
                        decimal.Parse(dr[TestDataInfrastructure.GetTestInputData("LastPrice")].ToString(), CultureInfo.InvariantCulture)));
            }

            return(market);
        }
コード例 #2
0
        public override List <MarketHistoryItem> GetData()
        {
            DataSet ds = new DataSet();

            ds.Locale = CultureInfo.CurrentCulture;
            ds.ReadXml(GetDataFilePath());
            DataRow dr = null;

            List <MarketHistoryItem> history = new List <MarketHistoryItem>();

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                dr = ds.Tables[0].Rows[i];
                history.Add(
                    new MarketHistoryItem(
                        dr[TestDataInfrastructure.GetTestInputData("TickerSymbol")].ToString(),
                        DateTime.Parse(dr[TestDataInfrastructure.GetTestInputData("Date")].ToString(), CultureInfo.InvariantCulture),
                        decimal.Parse(dr[2].ToString(), CultureInfo.InvariantCulture)
                        ));
            }

            return(history);
        }