コード例 #1
0
        public void TestRateTriangulationKo(String currencyBase, String currencyCounter, Boolean useTriangulation)
        {
            FxRatesProvider ratesProvider = m_TestsFixture.RatesProvider;

            Currency oCurrencyBase    = Currency.Parse(currencyBase);
            Currency oCurrencyCounter = Currency.Parse(currencyCounter);

            Assert.Throws <InvalidOperationException>(() => ratesProvider.GetRate(oCurrencyBase, oCurrencyCounter, useTriangulation));
        }
コード例 #2
0
        public void TestRateTriangulationOk(String currencyBase, String currencyCounter, Double result)
        {
            FxRatesProvider ratesProvider = m_TestsFixture.RatesProvider;

            Currency oCurrencyBase    = Currency.Parse(currencyBase);
            Currency oCurrencyCounter = Currency.Parse(currencyCounter);

            Decimal expected = Utilities.Round(result, 10);
            Decimal actual   = Utilities.Round(ratesProvider.GetRate(oCurrencyBase, oCurrencyCounter, true), 10);

            Assert.Equal(expected, actual);
        }