示例#1
0
        public async Task GetQuoteEndpointTest()
        {
            var key = _realKeySrvice.GetKey();

            _apiKeyServiceMock.Setup(q => q.GetKey()).Returns(key);
            var result = await _alphaVantageServiceReal.GetQuoteEndpointAsync(_testSymbol);

            Assert.NotNull(result);
            Assert.AreEqual(_testSymbol, result.Symbol);
        }
示例#2
0
        public async Task <IActionResult> GetQuoteEndpointAsync(string symbol)
        {
            var result = await _alphaVantageService.GetQuoteEndpointAsync(symbol);

            return(Ok(new
            {
                symbol,
                Data = result,
            }));
        }