private async Task TestTrade(IExchangeAPI api, string marketSymbol) { if (FunctionRegex == null || Regex.IsMatch("trade", FunctionRegex, RegexOptions.IgnoreCase)) { try { ExchangeTrade[] trades = null; Console.Write("Test {0} GetHistoricalTradesAsync... ", api.Name); await api.GetHistoricalTradesAsync(tradeEnum => { trades = tradeEnum.ToArray(); return(true); }, marketSymbol); Assert(trades.Length != 0 && trades[0].Price > 0m && trades[0].Amount > 0m); Console.WriteLine($"OK ({trades.Length})"); Console.Write("Test {0} GetRecentTradesAsync... ", api.Name); trades = (await api.GetRecentTradesAsync(marketSymbol)).ToArray(); Assert(trades.Length != 0 && trades[0].Price > 0m && trades[0].Amount > 0m); Console.WriteLine($"OK ({trades.Length} trades)"); } catch (NotImplementedException) { Console.WriteLine("Not implemented"); } } }