public void ForceUpdate()
        {
            if (_factorsProvider == null)
                _factorsProvider = new DefaultCurrenciesFactorProvider();

            _factorsProvider.UpdateFactors(_factorsLoader.LoadCurrenciesFactors());
        }
        public ICurrenciesFactorProvider CreateAndInitProvider()
        {
            if (_factorsProvider == null)
                _factorsProvider = new DefaultCurrenciesFactorProvider();

            InitFileWatcher();
            UpdateFactors();

            return _factorsProvider;
        }
        public ICurrenciesFactorProvider CreateAndInitProvider()
        {
            CheckDisposedFlag();

            if (_factorsProvider == null)
                _factorsProvider = new DefaultCurrenciesFactorProvider();

            InitTimer();
            UpdateFactorsSync();

            return _factorsProvider;
        }
        public void GetFactorTest()
        {
            var factorsPer1Usd = new CurrenciesFactorsPer1UnitInUsd();

            factorsPer1Usd[Currency.EUR] = 1.4m;
            factorsPer1Usd[Currency.JPY] = 2.8m;

            var target = new DefaultCurrenciesFactorProvider(factorsPer1Usd);

            Assert.AreEqual(0.5m, target.GetFactor(Currency.EUR, Currency.JPY));
            Assert.AreEqual(2m, target.GetFactor(Currency.JPY, Currency.EUR));
            Assert.AreEqual(1m/2.8m, target.GetFactor(Currency.USD, Currency.JPY));
            Assert.AreEqual(1m, target.GetFactor(Currency.USD, Currency.USD));
            Assert.AreEqual(1m, target.GetFactor(Currency.JPY, Currency.JPY));
            Assert.AreEqual(1m, target.GetFactor(Currency.USD, Currency.UNKNOWN));
        }