Пример #1
0
        public async Task GetAllExchanges()
        {
            var result = await _gateway.AllExchanges();

            Assert.True(result.IsSuccess);
            Assert.NotEmpty(result.Content);
            Assert.True(result.Content.Exists(e => e.GradePoints > 0));
            Assert.True(result.Content.Exists(e => string.IsNullOrEmpty(e.AffiliateURL) == false));
        }
Пример #2
0
        public async Task ImportAllExchanges()
        {
            var result = await _cryptoCompareGateway.AllExchanges();

            if (result?.Content?.Any() == true)
            {
                List <Exchange> exchanges = _mapper.Map <List <Exchange> >(result.Content);
                if (exchanges?.Any() == true)
                {
                    await _coreDBContext.AddRangeAsync(exchanges);

                    await _coreDBContext.SaveChangesAsync();
                }
            }
        }