Esempio n. 1
0
        public async Task CanParseRawMarketString()
        {
            var rawString = await DataHelper.GetRawMarketsString().ConfigureAwait(false);

            var res = MarketParser.Parse(rawString);

            Assert.True(res.Count > 0);
        }
Esempio n. 2
0
        public void CanCreateMarketsArray(string source)
        {
            var res = MarketParser.Parse(source);

            Assert.NotNull(res);
            Assert.AreEqual(3, res.Count);
            foreach (var market in res)
            {
                Assert.True(market.Id != 0);
                Assert.False(string.IsNullOrEmpty(market.Name));
#if DEBUG
                Console.WriteLine(market.ToJson());
#endif
            }
        }
Esempio n. 3
0
        public async Task <IList <Market> > LoadMarkets()
        {
            var data = await this.requestor.GetString(this.marketsFeedUrl).ConfigureAwait(false);

            return(MarketParser.Parse(data));
        }
Esempio n. 4
0
        public static async Task <IList <Market> > GetMarketsFromRawDataFile()
        {
            var source = await GetRawMarketsString().ConfigureAwait(false);

            return(MarketParser.Parse(source));
        }