コード例 #1
0
        public void EndPoint_ParsingTest()
        {
            var json    = File.ReadAllText("Data/endpoint-quote.json");
            var jObject = (JObject)JsonConvert.DeserializeObject(json);

            var parser = new StockDataParser();
            var result = parser.ParseEndPoint(jObject);

            Assert.NotNull(result);
            Assert.True(
                result.Symbol == "IBM" &&
                result.Price == 125.11m);
        }
コード例 #2
0
        public async Task <StockEndPoint> RequestQuoteEndpointAsync(string symbol)
        {
            var query = new Dictionary <string, string>()
            {
                { StockApiQueryVars.Symbol, symbol },
            };

            var jObject = await _coreClient.RequestApiAsync(_apiKey, ApiFunction.GLOBAL_QUOTE, query);

            var endPoint = _parser.ParseEndPoint(jObject);

            return(endPoint);
        }