private async Task <CoronaVirusApiTrackerMessage> CallApi() { var api = new GetDataFromApi(); string json = await api.GetJsonData(); var msg = new CoronaVirusApiTrackerMessage(); msg.PayloadJson = json; return(msg); }
public void GetDataFromApi() { //Arrange var getData = new GetDataFromApi(); //Act var result = getData.Request().Result; //Assert Assert.AreEqual(result.QuestionsText[0], "What is the capital of Cuba?"); Assert.AreEqual(result.QuestionsText[1], "What is the capital of France?"); Assert.AreEqual(result.QuestionsText[2], "What is the capital of Poland?"); Assert.AreEqual(result.QuestionsText[3], "What is the capital of Germany?"); }
public async Task Execute(IJobExecutionContext context) { //var get24hrTicker = new GetDataFromApi<_24hrTickerDto>(); var get24hrTicker = new GetDataFromApi <OrderBook>(); var BNBBTC_orderBook = await get24hrTicker.GetDataAsync(ApiUrl.orderBook, "BNBBTC"); //var BNBBTC_24hrTicker = await get24hrTicker.GetDataAsync(ApiUrl.Binance24hr, "BTC"); _logger.LogInformation("Торги BNBBTC"); _logger.LogInformation(BNBBTC_orderBook.ToString()); //_logger.LogInformation(BNBBTC_24hrTicker.ToString()); // return Task.CompletedTask; }