public void GetAnExchangeRate()
 {
     MockExchangeRateApi api = new MockExchangeRateApi();
     Exchange exchange = new Exchange(api);
     double rate = exchange.GetRate("GBP", "EUR");
     Assert.Equal(1.357, rate);
 }
Beispiel #2
0
        internal double Convert(string from, string to, int amount)
        {
            double converted      = amount * exchange.GetRate(from, to);
            double valueRoundedUp = Math.Ceiling(converted * 100.0) / 100;

            return(valueRoundedUp);
        }
Beispiel #3
0
        public void GetAnExchangeRate()
        {
            MockExchangeRateApi api      = new MockExchangeRateApi();
            Exchange            exchange = new Exchange(api);
            double rate = exchange.GetRate("GBP", "EUR");

            Assert.Equal(1.357, rate);
        }