Beispiel #1
0
        public FilterCryptoViewModel(ICoinMarketCapService coinMarketCapService)
        {
            _coinMarketCapService = coinMarketCapService;

            LoadAsyncData();
            InitializeCommands();
        }
Beispiel #2
0
 public TimedCoinMarketCacheUpdateService(
     ICoinMarketServiceConfiguration configuration,
     ICoinMarketCapService coinMarketCapService)
 {
     _configuration        = configuration;
     _coinMarketCapService = coinMarketCapService;
 }
Beispiel #3
0
        public IndexCalculator(string indexName,
                               TimeSpan indexCalculationInterval,
                               ISettingsService settingsService,
                               IIndexStateRepository indexStateRepository,
                               IIndexHistoryRepository indexHistoryRepository,
                               ITickPricesService tickPricesService,
                               ICoinMarketCapService coinMarketCapService,
                               ITickPricePublisher tickPricePublisher,
                               IWarningRepository warningRepository,
                               IFirstStateAfterResetTimeRepository firstStateAfterResetTimeRepository,
                               IIndexHandler indexHandler,
                               ILogFactory logFactory)
        {
            _lastRebuild            = DateTime.UtcNow.Date;
            _allMarketCaps          = new List <AssetMarketCap>();
            _topAssets              = new List <string>();
            _lastTopAssetMarketCaps = new ConcurrentDictionary <string, decimal>();

            _indexName = indexName;
            _trigger   = new TimerTrigger(nameof(IndexCalculator), indexCalculationInterval, logFactory, TimerHandlerAsync);

            _settingsService                    = settingsService;
            _indexStateRepository               = indexStateRepository;
            _indexHistoryRepository             = indexHistoryRepository;
            _tickPricesService                  = tickPricesService;
            _coinMarketCapService               = coinMarketCapService;
            _tickPricePublisher                 = tickPricePublisher;
            _warningRepository                  = warningRepository;
            _firstStateAfterResetTimeRepository = firstStateAfterResetTimeRepository;
            _indexHandler = indexHandler;

            _log = logFactory.CreateLog(this);
        }
Beispiel #4
0
        public CryptoListViewModel(ICoinMarketCapService coinMarketCapService)
        {
            _coinMarketCapService = coinMarketCapService;
            FilterCryptoViewModel = ContainerHelper.Container.Resolve <FilterCryptoViewModel>();
            FilterCryptoViewModel.FiltersApplied += FilterCryptoViewModel_FiltersApplied;

            InitializeCommands();
            LoadAsyncData();
        }
Beispiel #5
0
 public GetLatestCryptoCurrencyQuotesHandler(ICryptoRepository cryptoRepository,
                                             ICurrencyRepository currencyRepository, ICoinMarketCapService coinMarketCapService,
                                             IForeignExchangeRateService exchangeRateService)
 {
     _cryptoRepository     = cryptoRepository ?? throw new ArgumentNullException(nameof(cryptoRepository));
     _currencyRepository   = currencyRepository ?? throw new ArgumentNullException(nameof(currencyRepository));
     _coinMarketCapService =
         coinMarketCapService ?? throw new ArgumentNullException(nameof(coinMarketCapService));
     _exchangeRateService = exchangeRateService ?? throw new ArgumentNullException(nameof(exchangeRateService));
 }
Beispiel #6
0
        private void InitializeCoinMarketCapService()
        {
            var coinMarketCapService = new Mock <ICoinMarketCapService>();

            coinMarketCapService.Setup(o => o.GetAllAsync()).Returns(() =>
            {
                var result = new List <AssetMarketCap>();

                var supplies = GetSupply(_step);

                foreach (var supply in supplies)
                {
                    result.Add(new AssetMarketCap(supply.Key, new MarketCap(0, Usd), supply.Value));
                }

                return(Task.FromResult((IReadOnlyList <AssetMarketCap>)result));
            });

            _coinMarketCapService = coinMarketCapService.Object;
        }
Beispiel #7
0
 public CryptoService(ICoinMarketCapService coinMarketCapService)
 {
     _coinMarketCapService = coinMarketCapService;
 }
 public CoinMarketController(ICoinMarketCapService coinMarketCapService)
 {
     _coinMarketCapService = coinMarketCapService;
 }
Beispiel #9
0
 public FillDataFromServerHandler(ICryptoRepository cryptoRepository, ICoinMarketCapService coinMarketCapService)
 {
     _cryptoRepository     = cryptoRepository;
     _coinMarketCapService = coinMarketCapService;
 }
 public CurrencyConverterService(INationalBankOfRepublicBelarusServise bankOfRepublicBelarusServise, ICoinMarketCapService coinMarketCapService)
 {
     _bankOfRepublicBelarusServise = bankOfRepublicBelarusServise;
     _coinMarketCapService         = coinMarketCapService;
 }
 public CurrencyService(ICoinMarketCapService coinMarketCapService, ICalculator calculator)
 {
     _coinMarketCapService = coinMarketCapService;
     _calculator           = calculator;
 }