Exemple #1
0
        public async Task Add_get(DepositDetails details)
        {
            IDb db = new MemDb();
            DepositDetailsRocksRepository repository = new DepositDetailsRocksRepository(db, new DepositDetailsDecoder());
            await repository.AddAsync(details);

            DepositDetails retrieved = await repository.GetAsync(details.Id);

            retrieved.Should().BeEquivalentTo(details);
        }
Exemple #2
0
        public async Task Get_assets(DepositDetails depositDetails)
        {
            IDb db = new MemDb();
            DepositDetailsRocksRepository detailsRocksRepository = new DepositDetailsRocksRepository(db, new DepositDetailsDecoder());
            await detailsRocksRepository.AddAsync(depositDetails);
            
            ProviderRocksRepository repository = new ProviderRocksRepository(db, new DepositDetailsDecoder());

            var retrieved = await repository.GetDataAssetsAsync();
            retrieved.Count.Should().Be(1);
        }
Exemple #3
0
        public async Task Get_providers(DepositDetails depositDetails)
        {
            IDb db = new MemDb();
            IDepositUnitsCalculator       depositUnitsCalculator = Substitute.For <IDepositUnitsCalculator>();
            DepositDetailsRocksRepository detailsRocksRepository = new DepositDetailsRocksRepository(db, new DepositDetailsDecoder(), depositUnitsCalculator);
            await detailsRocksRepository.AddAsync(depositDetails);

            ProviderRocksRepository repository = new ProviderRocksRepository(db, new DepositDetailsDecoder());

            var retrieved = await repository.GetProvidersAsync();

            retrieved.Count.Should().Be(1);
        }
Exemple #4
0
        public async Task Browse_empty()
        {
            IDb db = new MemDb();
            DepositDetailsRocksRepository repository = new DepositDetailsRocksRepository(db, new DepositDetailsDecoder());

            foreach (DepositDetails details in _cases)
            {
                await repository.AddAsync(details);
            }

            PagedResult <DepositDetails> result = await repository.BrowseAsync(new GetDeposits { EligibleToRefund = true });

            result.Items.Should().HaveCount(0);
        }
Exemple #5
0
        public async Task Browse_unconfirmed_only()
        {
            IDb db = new MemDb();
            DepositDetailsRocksRepository repository = new DepositDetailsRocksRepository(db, new DepositDetailsDecoder());

            foreach (DepositDetails details in _cases)
            {
                await repository.AddAsync(details);
            }

            PagedResult <DepositDetails> result = await repository.BrowseAsync(new GetDeposits { OnlyUnconfirmed = true });

            result.Items.Should().HaveCount(01);
        }
        public async Task Add_get(DepositDetails details)
        {
            await repository.AddAsync(details);

            DepositDetails retrieved = await repository.GetAsync(details.Id);

            retrieved.Should().BeEquivalentTo(details);
        }