Пример #1
0
        public async Task GetWalletBalanceByWalletAndAssetId()
        {
            string url      = ApiPaths.WALLETS_BASE_PATH + "/" + this.TestWallet.Id + "/balances/" + this.TestAssetId;
            var    response = await this.Consumer.ExecuteRequest(url, Helpers.EmptyDictionary, null, Method.GET);

            Assert.True(response.Status == HttpStatusCode.OK);
            WBalanceDTO parsedResponse = JsonUtils.DeserializeJson <WBalanceDTO>(response.ResponseJson);

            BalanceDTO accountBalance = this.TestWalletAccount.BalancesParsed.Where(b => b.Asset == this.TestAssetId).FirstOrDefault();

            Assert.NotNull(accountBalance);
            Assert.True(parsedResponse.Balance == accountBalance.Balance);
        }
Пример #2
0
        public async Task GetWalletTradeBalanceByAssetId()
        {
            string url      = ApiPaths.WALLETS_TRADING_BALANCES_PATH + "/" + this.TestAssetId;
            var    response = await this.Consumer.ExecuteRequest(url, Helpers.EmptyDictionary, null, Method.GET);

            Assert.True(response.Status == HttpStatusCode.OK);
            WBalanceDTO parsedResponse = JsonUtils.DeserializeJson <WBalanceDTO>(response.ResponseJson);

            AccountEntity entity = await this.AccountRepository.TryGetAsync(this.TestClientId) as AccountEntity;

            Assert.NotNull(entity);
            BalanceDTO entityBalance = entity.BalancesParsed.Where(b => b.Asset == this.TestAssetId).FirstOrDefault();

            Assert.NotNull(entityBalance);

            Assert.True(entityBalance.Balance == parsedResponse.Balance);
        }
Пример #3
0
        public async Task GetWalletTradeBalances()
        {
            string url      = ApiPaths.WALLETS_TRADING_BALANCES_PATH;
            var    response = await this.Consumer.ExecuteRequest(url, Helpers.EmptyDictionary, null, Method.GET);

            Assert.True(response.Status == HttpStatusCode.OK);
            List <WBalanceDTO> parsedResponse = JsonUtils.DeserializeJson <List <WBalanceDTO> >(response.ResponseJson);

            AccountEntity entity = await this.AccountRepository.TryGetAsync(this.TestWallet.Id) as AccountEntity;

            Assert.NotNull(entity);

            foreach (BalanceDTO entityBalance in entity.BalancesParsed)
            {
                WBalanceDTO responseBalance = parsedResponse.Where(b => b.AssetId == entityBalance.Asset).FirstOrDefault();
                Assert.NotNull(responseBalance);
                Assert.True(entityBalance.Balance == responseBalance.Balance);
            }
        }