public ExchangeRateRefreshService(IConfiguration configuration, IExchangeRatesService exchangeRatesService) { _schedule = CrontabSchedule.Parse(configuration.GetValue <string>("ExchangeRateRefreshCronSchedule")); _nextExecution = _schedule.GetNextOccurrence(DateTime.Now); _exchangeRatesService = exchangeRatesService; }
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)); }
public ExchangeRatesApiControllerTests() { _fixture = new Fixture(); _exchangeRatesService = Substitute.For <IExchangeRatesService>(); _apiKeyGeneratorService = Substitute.For <IApiKeyGeneratorService>(); _config = _fixture.Create <MyConfig>(); }
public APIHelperService(IConfiguration configuration, IExchangeRatesService exchangeRatesService, ICalculationHelperService calculationHelper, IAPIInteractionService aPIInteraction) { _configuration = configuration; _calculationHelper = calculationHelper; _aPIInteraction = aPIInteraction; _exchangeRatesService = exchangeRatesService; }
public BalanceSheetManager( IExchangeRatesService exchangeRatesService, IBalanceSheetRepository balanceSheetRepository ) { this.ExchangeRatesService = exchangeRatesService; this.BalanceSheetRepository = balanceSheetRepository; }
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()); }
public TradePositionWeightedAverageExchangeRateService( IExchangeRatesService exchangeRatesService, ILogger <TradePositionWeightedAverageExchangeRateService> logger) { this._exchangeRatesService = exchangeRatesService ?? throw new ArgumentNullException(nameof(exchangeRatesService)); this._logger = logger ?? throw new ArgumentNullException(nameof(logger)); }
public FetchExchangeData(ILogger <FetchExchangeData> logger, IConfiguration configuration, IAPIInteractionService aPIInteraction, ICalculationHelperService calculationHelper, IExchangeRatesService exchangeRatesService) { _logger = logger; _configuration = configuration; _aPIInteraction = aPIInteraction; _calculationHelper = calculationHelper; _exchangeRatesService = exchangeRatesService; }
/// <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; }
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>(); }
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"; }
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); }
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); }
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)); }; }
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(); }
public Manager(IDatabaseWrapper databaseWrapper, IExchangeRatesService openExchangeRatesService) { _databaseWrapper = databaseWrapper ?? ModelContainer.Instance.Resolve<IDatabaseWrapper>(); _openExchangeRatesService = openExchangeRatesService ?? ModelContainer.Instance.Resolve<IExchangeRatesService>(); }
public FundsTransferService(IExchangeRatesService exchangeRatesService) { _exchangeRatesService = exchangeRatesService; }
public ExchangeRatesController(ExchangeRatesDbContext dbContext, IExchangeRatesService exchangeRatesService) { _exchangeRatesService = exchangeRatesService; _dbContext = dbContext; }
public ExchangeRatesServiceController(ILogger <ExchangeRatesServiceController> logger, IExchangeRatesService exchangeRatesService) { _logger = logger; _exchangeRatesService = exchangeRatesService; }
public IGetCurrentQuotesForCryptocurrency Create(IExchangeRatesService exchangeRatesService) => new GetCurrentQuotesForCryptocurrency(exchangeRatesService);
public ExchangeRatesController(IExchangeRatesService exchangeRatesService) { this.exchangeRatesService = exchangeRatesService; }
public ExchangeRatesController(IExchangeRatesService exchangeRatesService, IMapper mapper) { _exchangeRatesService = exchangeRatesService; _mapper = mapper; }
public RatesController(IExchangeRatesService exchangeRateService) { _exchangeRateService = exchangeRateService; }
public BricklinkClient(HttpClient httpClient, IExchangeRatesService currencyRatesService) { _httpClient = httpClient; _currencyRatesService = currencyRatesService; }
public ExchangeRatesApiController(IExchangeRatesService exchangeRatesService, IApiKeyGeneratorService apiKeyGeneratorService, MyConfig config) { _exchangeRatesService = exchangeRatesService; _apiKeyGeneratorService = apiKeyGeneratorService; _config = config; }
public ExchangeRateController(IExchangeRatesService exchangeRatesService) { _exchangeRatesService = exchangeRatesService ?? throw new ArgumentException(nameof(exchangeRatesService)); }
public GetCurrentQuotesForCryptocurrency(IExchangeRatesService exchangeRatesService) { _exchangeRatesService = exchangeRatesService ?? throw new ArgumentNullException(nameof(exchangeRatesService)); }