コード例 #1
0
 public ExchangeRateRefreshService(IConfiguration configuration,
                                   IExchangeRatesService exchangeRatesService)
 {
     _schedule             = CrontabSchedule.Parse(configuration.GetValue <string>("ExchangeRateRefreshCronSchedule"));
     _nextExecution        = _schedule.GetNextOccurrence(DateTime.Now);
     _exchangeRatesService = exchangeRatesService;
 }
コード例 #2
0
 public ExchangeRatesController(IBankWorkerService bankWorkerService, IUserContextService userContextService, IExchangeRatesService exchangeRatesService, IBankService bankService)
 {
     _exchangeRatesService = exchangeRatesService ?? throw new ArgumentNullException(nameof(exchangeRatesService));
     _bankService          = bankService ?? throw new ArgumentNullException(nameof(bankService));
     _bankWorkerService    = bankWorkerService ?? throw new ArgumentNullException(nameof(bankWorkerService));
     _userContextService   = userContextService ?? throw new ArgumentNullException(nameof(userContextService));
 }
コード例 #3
0
 public ExchangeRatesApiControllerTests()
 {
     _fixture = new Fixture();
     _exchangeRatesService   = Substitute.For <IExchangeRatesService>();
     _apiKeyGeneratorService = Substitute.For <IApiKeyGeneratorService>();
     _config = _fixture.Create <MyConfig>();
 }
コード例 #4
0
 public APIHelperService(IConfiguration configuration, IExchangeRatesService exchangeRatesService,
                         ICalculationHelperService calculationHelper, IAPIInteractionService aPIInteraction)
 {
     _configuration        = configuration;
     _calculationHelper    = calculationHelper;
     _aPIInteraction       = aPIInteraction;
     _exchangeRatesService = exchangeRatesService;
 }
コード例 #5
0
 public BalanceSheetManager(
     IExchangeRatesService exchangeRatesService,
     IBalanceSheetRepository balanceSheetRepository
     )
 {
     this.ExchangeRatesService   = exchangeRatesService;
     this.BalanceSheetRepository = balanceSheetRepository;
 }
コード例 #6
0
 public AddEditExchangeRateViewModel(IExchangeRatesService exchangeRatesService, ICurrenciesService currenciesService)
 {
     _exchangeRatesService           = exchangeRatesService;
     _currenciesService              = currenciesService;
     CancelCommand                   = new RelayCommand(OnCancel);
     SaveCommand                     = new RelayCommand(OnSave, CanSave);
     CurrenciesDropDownOpenedCommand = new RelayCommand(OnCurrenciesDropDownOpened, () => Currencies != null && Currencies.Any());
 }
コード例 #7
0
 public TradePositionWeightedAverageExchangeRateService(
     IExchangeRatesService exchangeRatesService,
     ILogger <TradePositionWeightedAverageExchangeRateService> logger)
 {
     this._exchangeRatesService =
         exchangeRatesService ?? throw new ArgumentNullException(nameof(exchangeRatesService));
     this._logger = logger ?? throw new ArgumentNullException(nameof(logger));
 }
コード例 #8
0
 public FetchExchangeData(ILogger <FetchExchangeData> logger, IConfiguration configuration,
                          IAPIInteractionService aPIInteraction, ICalculationHelperService calculationHelper, IExchangeRatesService exchangeRatesService)
 {
     _logger               = logger;
     _configuration        = configuration;
     _aPIInteraction       = aPIInteraction;
     _calculationHelper    = calculationHelper;
     _exchangeRatesService = exchangeRatesService;
 }
コード例 #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DashboardService"/> class.
 /// </summary>
 /// <param name="configuration">The configuration.</param>
 /// <param name="dashboardLogHistoryRepository">The dashboard log history repository.</param>
 /// <param name="iIPStackService">The i ip stack service.</param>
 /// <param name="exchangeRatesService">The exchange rates service.</param>
 /// <param name="yahooFinanceService">The yahoo finance service.</param>
 public DashboardService(IConfiguration configuration, IDashboardLogHistoryRepository dashboardLogHistoryRepository,
                         IIPStackService iIPStackService, IExchangeRatesService exchangeRatesService, IYahooFinanceService yahooFinanceService, UserManager <ApplicationUser> userManager)
 {
     this.configuration = configuration;
     this.dashboardLogHistoryRepository = dashboardLogHistoryRepository;
     this.iIPStackService      = iIPStackService;
     this.exchangeRatesService = exchangeRatesService;
     this.yahooFinanceService  = yahooFinanceService;
     this.userManager          = userManager;
 }
コード例 #10
0
 public ExchangeRateListViewModel(IExchangeRatesService exchangeRatesService, ICurrenciesService currenciesService, ICompanyInformationsService companyInformationsService)
 {
     _companyInformationsService = companyInformationsService;
     CompanyInformationModel     = _companyInformationsService.GetCompanyInformationModel();
     _currenciesService          = currenciesService;
     _exchangeRatesService       = exchangeRatesService;
     AddExchangeRateCommand      = new RelayCommand(OnAddExchangeRate);
     EditExchangeRateCommand     = new RelayCommand <ExchangeRate>(OnEditExchangeRate);
     DeleteCommand  = new RelayCommand <ExchangeRate>(OnDeleteExchangeRate);
     _accessUtility = SmObjectFactory.Container.GetInstance <AccessUtility>();
 }
コード例 #11
0
        public CoinMarketCapExchangeRatesWebServiceTests()
        {
            _mockServer = WireMockServer.Start();

            var configuration = new CoinMarketCapWebServiceConfiguration
            {
                BaseUrl = new Uri(_mockServer.Urls.First()),
                ApiKey  = SampleApiKeyValue
            };

            _exchangeRatesService = QuotesServicesFactory.Infrastructure.ExchangeRatesService
                                    .CreateCoinMarketCapExchangeRatesWebService(CreateHttpClientFactory(), configuration);
        }
        public void Setup()
        {
            this._logger               = A.Fake <ILogger <ExchangeRateApi> >();
            this._loggerExchRate       = A.Fake <ILogger <ExchangeRatesService> >();
            this._ruleCtx              = A.Fake <ISystemProcessOperationRunRuleContext>();
            this._calculatorLogger     = A.Fake <ILogger <TradePositionWeightedAverageExchangeRateService> >();
            this._exchangeRatesService = A.Fake <IExchangeRatesService>();
            this._currency             = new Currency("GBX");
            this._policyFactory        = A.Fake <IPolicyFactory>();

            this._configuration = A.Fake <IApiClientConfiguration>();
            this._configuration.ClientServiceUrl = "http://localhost:8080";
            this._configuration.SurveillanceUserApiAccessToken = "uwat";
        }
コード例 #13
0
        public ExchangeRatesServiceTests()
        {
            var configurationSectionMock = new Mock <IConfigurationSection>();

            configurationSectionMock.Setup(x => x.Value)
            .Returns("https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml");
            var configurationMock = new Mock <IConfiguration>();

            configurationMock.Setup(x => x.GetSection(It.IsAny <string>()))
            .Returns(configurationSectionMock.Object);
            var mockHttpClientFactory = new Mock <IHttpClientFactory>();

            mockHttpClientFactory.Setup(x => x.CreateClient(It.IsAny <string>())).Returns(() => new HttpClient());

            _service = new ExchangeRatesService(configurationMock.Object, mockHttpClientFactory.Object);
        }
コード例 #14
0
        public async Task <bool> ValidateSymbols(IExchangeRatesService exchangeRatesService, params string[] keys)
        {
            _exchangeRatesService = exchangeRatesService;

            var symbols = await GetSupportedSymbols();

            var invalidSymbols = keys.Where(k => !symbols.Contains(k.ToUpper()));

            if (invalidSymbols.Any())
            {
                var dict = GetSupportedSymbolsDictionary();

                throw new InputFormatArgumentException("Currency symbol", $"{ string.Join(",", invalidSymbols)}. Supported symbols: {string.Join(",", symbols)}");
            }

            return(true);
        }
コード例 #15
0
        public ExchangeRatesModule()
            : base("/")
        {
            _exchangeRatesService = new ExchangeRatesService();

            Post["/"] = parameters =>
            {
                var request = this.Bind <ExchangeRatesRequest>();

                var validationResult = this.Validate(request);
                if (!validationResult.IsValid)
                {
                    return(Negotiate.WithModel(validationResult).WithStatusCode(HttpStatusCode.BadRequest));
                }

                return(_exchangeRatesService.GetExchangeRatesFor(request));
            };
        }
コード例 #16
0
 public AccDocumentItemListViewModel(IAccDocumentItemsService accDocumentItemsService, ISLsService sLsService, IExchangeRatesService exchangeRatesService, ICurrenciesService currenciesService, ISLStandardDescriptionsService sLStandardDescriptionsService)
 {
     _accDocumentItemsService = accDocumentItemsService;
     _sLsService                    = sLsService;
     _exchangeRatesService          = exchangeRatesService;
     _currenciesService             = currenciesService;
     _sLStandardDescriptionsService = sLStandardDescriptionsService;
     //EditAccDocumentItemCommand = new RelayCommand<AccDocumentItem>(OnEditAccDocumentItem);
     DeleteCommand = new RelayCommand <EditableAccDocumentItem>(OnDeleteAccDocumentItem);
     // CancelCommand = new RelayCommand(OnCancel);
     SaveCommand = new RelayCommand(OnSave, CanSave);
     SLsDropDownOpenedCommand = new RelayCommand(OnSLsDropDownOpened);
     DLsDropDownOpenedCommand = new RelayCommand <string>(OnDLsDropDownOpened);
     SLStandardDescriptionsDropDownOpenedCommand = new RelayCommand <string>(OnSLStandardDescriptionsDropDownOpened);
     CurrenciesDropDownOpenedCommand             = new RelayCommand <string>(OnCurrenciesDropDownOpened);
     ExchangeRatesDropDownOpenedCommand          = new RelayCommand <string>(OnExchangeRatesDropDownOpened);
     CanAdd         = true;
     _accessUtility = SmObjectFactory.Container.GetInstance <AccessUtility>();
 }
 public OpeningClosingDocItemListViewModel(IAccDocumentItemsService accDocumentItemsService, ISLsService sLsService, IExchangeRatesService exchangeRatesService, ICurrenciesService currenciesService, ISLStandardDescriptionsService sLStandardDescriptionsService)
 {
     _accDocumentItemsService = accDocumentItemsService;
     _sLsService                    = sLsService;
     _exchangeRatesService          = exchangeRatesService;
     _currenciesService             = currenciesService;
     _sLStandardDescriptionsService = sLStandardDescriptionsService;
     //EditAccDocumentItemCommand = new RelayCommand<AccDocumentItem>(OnEditAccDocumentItem);
     DeleteCommand = new RelayCommand <EditableAccDocumentItem>(OnDeleteAccDocumentItem);
     // CancelCommand = new RelayCommand(OnCancel);
     SaveCommand              = new RelayCommand(OnSave, CanSave);
     CancelCommand            = new RelayCommand(OnCancel);
     SLsDropDownOpenedCommand = new RelayCommand(OnSLsDropDownOpened);
     DLsDropDownOpenedCommand = new RelayCommand <string>(OnDLsDropDownOpened);
     SLStandardDescriptionsDropDownOpenedCommand = new RelayCommand <string>(OnSLStandardDescriptionsDropDownOpened);
     CurrenciesDropDownOpenedCommand             = new RelayCommand <string>(OnCurrenciesDropDownOpened);
     ExchangeRatesDropDownOpenedCommand          = new RelayCommand <string>(OnExchangeRatesDropDownOpened);
     CanAdd            = true;
     AccDocumentHeader = new EditableAccDocumentHeader();
 }
コード例 #18
0
ファイル: Manager.cs プロジェクト: om471987/ExchangeRates
 public Manager(IDatabaseWrapper databaseWrapper, IExchangeRatesService openExchangeRatesService)
 {
     _databaseWrapper = databaseWrapper ?? ModelContainer.Instance.Resolve<IDatabaseWrapper>();
     _openExchangeRatesService = openExchangeRatesService ?? ModelContainer.Instance.Resolve<IExchangeRatesService>();
 }
コード例 #19
0
 public FundsTransferService(IExchangeRatesService exchangeRatesService)
 {
     _exchangeRatesService = exchangeRatesService;
 }
コード例 #20
0
 public ExchangeRatesController(ExchangeRatesDbContext dbContext, IExchangeRatesService exchangeRatesService)
 {
     _exchangeRatesService = exchangeRatesService;
     _dbContext            = dbContext;
 }
コード例 #21
0
 public ExchangeRatesServiceController(ILogger <ExchangeRatesServiceController> logger, IExchangeRatesService exchangeRatesService)
 {
     _logger = logger;
     _exchangeRatesService = exchangeRatesService;
 }
コード例 #22
0
 public IGetCurrentQuotesForCryptocurrency Create(IExchangeRatesService exchangeRatesService) =>
 new GetCurrentQuotesForCryptocurrency(exchangeRatesService);
コード例 #23
0
 public ExchangeRatesController(IExchangeRatesService exchangeRatesService)
 {
     this.exchangeRatesService = exchangeRatesService;
 }
 public ExchangeRatesController(IExchangeRatesService exchangeRatesService, IMapper mapper)
 {
     _exchangeRatesService = exchangeRatesService;
     _mapper = mapper;
 }
コード例 #25
0
 public RatesController(IExchangeRatesService exchangeRateService)
 {
     _exchangeRateService = exchangeRateService;
 }
コード例 #26
0
 public BricklinkClient(HttpClient httpClient, IExchangeRatesService currencyRatesService)
 {
     _httpClient           = httpClient;
     _currencyRatesService = currencyRatesService;
 }
コード例 #27
0
 public ExchangeRatesApiController(IExchangeRatesService exchangeRatesService, IApiKeyGeneratorService apiKeyGeneratorService, MyConfig config)
 {
     _exchangeRatesService   = exchangeRatesService;
     _apiKeyGeneratorService = apiKeyGeneratorService;
     _config = config;
 }
コード例 #28
0
 public ExchangeRateController(IExchangeRatesService exchangeRatesService)
 {
     _exchangeRatesService = exchangeRatesService ?? throw new ArgumentException(nameof(exchangeRatesService));
 }
 public GetCurrentQuotesForCryptocurrency(IExchangeRatesService exchangeRatesService)
 {
     _exchangeRatesService = exchangeRatesService ?? throw new ArgumentNullException(nameof(exchangeRatesService));
 }