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); }
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); }