コード例 #1
0
        public void Test_When_MoneyCurrencyIsNotDKK_ItReturnsCorrectExchangeRate()
        {
            var mocks = new MockRepository(MockBehavior.Default);

            var logger = mocks.Create <ILogger>();

            var retriever = new ExchangeRateRetriever(new HardCodedExchangeRateStore(), logger.Object);

            Assert.AreEqual(EURUSD, retriever.ExchangeRate(MainCurrency, MoneyCurrency));
        }
コード例 #2
0
        public void Test_When_MainOrMoneyCurrencyIsNotInStore_ItThrowsArgumentException()
        {
            var mocks = new MockRepository(MockBehavior.Default);

            var logger = mocks.Create <ILogger>();

            var retriever = new ExchangeRateRetriever(new HardCodedExchangeRateStore(), logger.Object);

            var d = retriever.ExchangeRate("ARS", DKK);
        }
コード例 #3
0
        public void Test_When_MainCurrencyAndMoneyCurrencyAreTheSame_ItReturnsOne()
        {
            var mocks = new MockRepository(MockBehavior.Default);

            var exchageRateStore = mocks.Create <IExchangeRateStore>();

            var logger = mocks.Create <ILogger>();

            var retriever = new ExchangeRateRetriever(exchageRateStore.Object, logger.Object);

            Assert.AreEqual(1.0, retriever.ExchangeRate(MainCurrency, MainCurrency));
        }