private async Task ListAccountsAsync(CancellationToken cancellationToken) { var accounts = await _restClient.ListAccountsAsync(cancellationToken) .ConfigureAwait(false); var toPrint = string.Join("\n", accounts.Select(p => p.ToString())); _logger.LogInformation($"Accounts: {toPrint}"); }
public async Task Test_ListAccounts() { var accounts = await _restClient.ListAccountsAsync(_token).ConfigureAwait(false); accounts.Should().NotBeNull(); var expected = new[] { new AccountInfo { Id = SpotAccountId, Kind = AccountKind.Spot }, new AccountInfo { Id = MarginAccountId, Kind = AccountKind.Margin, Currency = "BTC" }, }; accounts.Should().BeEquivalentTo <AccountInfo>(expected); }