public ExchangeServiceTest()
        {
            exchange = new ExchangeService();
            var  twd      = Currency.Create("TWD", 2);
            var  usd      = Currency.Create("USD", 2);
            Pair TWDtoUSD = new Pair(twd, usd);
            Pair USDtoTWD = new Pair(usd, twd);

            exchange.AddRate(TWDtoUSD, 5);
            exchange.AddRate(USDtoTWD, 0.2M);
        }
        public void test_add_rate_than_list_should_be_added()
        {
            //Given
            var fakePair    = new Pair(test1, test2);
            var originCount = exchange.RateList.Count;

            //When
            exchange.AddRate(fakePair, 2);
            //Then
            Assert.Equal(originCount + 1, exchange.RateList.Count);
        }
Esempio n. 3
0
 public void AddRate(string source, string to, int rate)
 {
     _exchangeService.AddRate(source, to, rate);
 }