예제 #1
0
        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}");
        }
예제 #2
0
        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);
        }