public CurrencyRateService(IMapper mapper, ICurrencyRatesRepository currencyRatesRepo, IOptions <AppSettings> appSettingsOptions)
        {
            _currencyRatesRepo = currencyRatesRepo;
            _mapper            = mapper;

            AppSettings appSettings = appSettingsOptions.Value;

            _updateReverseRate = appSettings.getUpdateReverseRateSetting();
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance of
 /// type CurrencysService.
 /// </summary>
 /// <param name="CurrencysRepository"></param>
 /// <param name="unitOfWork"></param>
 public CurrencysService(
     ICurrencysRepository CurrencysRepository,
     ICurrencyRatesRepository currencyRatesRepository,
     ILanguageService languageService,
     IUnitOfWork unitOfWork)
 {
     this._CurrencysRepository     = CurrencysRepository;
     this._currencyRatesRepository = currencyRatesRepository;
     this._languageService         = languageService;
     this._unitOfWork = unitOfWork;
 }
Example #3
0
 public ProductsBL(IProductsRepository productsRepository, IProductPhotosRepository productPhotosRepository,
                   IUserHostAddressesRepository userHostAddressesRepository, IProductViewingInfosRepository productViewingInfosRepository,
                   IUserStore <ApplicationUser> usersStore, ICurrenciesRepository currenciesRepository,
                   ICurrencyRatesRepository currencyRatesRepository)
 {
     _productsRepository            = productsRepository;
     _productPhotosRepository       = productPhotosRepository;
     _userHostAddressesRepository   = userHostAddressesRepository;
     _productViewingInfosRepository = productViewingInfosRepository;
     _usersStore              = usersStore;
     _currenciesRepository    = currenciesRepository;
     _currencyRatesRepository = currencyRatesRepository;
 }
Example #4
0
        public void GetActualRate_2()
        {
            //Arrange
            ResetDataBase();

            DateTime date = DateTime.Now;
            ICurrencyRatesRepository currencyRatesRepository = DI.Resolve <ICurrencyRatesRepository>();

            //Act
            CurrencyRate currencyRate = currencyRatesRepository.GetActualRate(3, date);

            //Asserts
            Assert.That(currencyRate.Id, Is.EqualTo(1));
        }
Example #5
0
 public CurrencyRatesController(ICurrencyRatesRepository currencyRatesRepository, ILogger <CurrencyRatesController> logger)
 {
     _currencyRatesRepository = currencyRatesRepository;
     _logger = logger;
 }
Example #6
0
 public CurrencyRatesService(IExchangeClient exchangeClient, ICurrencyRatesRepository currencyRatesRepository)
 {
     this.exchangeClient          = exchangeClient ?? throw new ArgumentNullException(nameof(exchangeClient));
     this.currencyRatesRepository = currencyRatesRepository ?? throw new ArgumentNullException(nameof(currencyRatesRepository));
 }
 public CurrencyRateController(ICurrencyRatesRepository repository)
 {
     this.repository = repository;
 }
Example #8
0
 public CurrencyRatesBL(ICurrencyRatesRepository currencyRatesRepository, IProductsRepository productsRepository)
 {
     _currencyRatesRepository = currencyRatesRepository;
     _productsRepository      = productsRepository;
 }
 public ExchangeService(ICurrencyRatesRepository currencyRatesRepository)
 {
     _currencyRatesRepository = currencyRatesRepository;
 }