Example #1
0
        public void GetCurrenciesForDate_WithSymbolsSet_ReturnsRatesOnlyForThoseSymbols()
        {
            var sut = new FixerIOClient()
            {
                Symbols = new[] { "ZAR", "USD" }
            };

            var result = sut.GetRatesForDate(new DateTime(2010, 01, 01));

            Assert.True(result.Rates.Any(r => r.Key != "ZAR" && r.Key != "ZAR"));
        }
Example #2
0
        public void GetCurrenciesForDate_WithDefaults_ReturnsRates()
        {
            var sut = new FixerIOClient();

            var result = sut.GetRatesForDate(new DateTime(2010, 01, 01));

            Assert.NotNull(result);
            Assert.NotNull(result.Rates);
            Assert.True(result.Rates.Any());
            Assert.False(string.IsNullOrWhiteSpace(result.Base));
            Assert.AreNotEqual(default(DateTime), result.Date);
        }
Example #3
0
        public void GetCurrenciesForDate_WithDifferentBaseSet_ReturnsRatesOnlyForThoseSymbols()
        {
            var sut = new FixerIOClient()
            {
                BaseCurrency = "USD"
            };

            var result = sut.GetRatesForDate(new DateTime(2010, 01, 01));

            Assert.NotNull(result);
            Assert.NotNull(result.Rates);
            Assert.True(result.Rates.Any());
            Assert.False(string.IsNullOrWhiteSpace(result.Base));
            Assert.AreNotEqual(default(DateTime), result.Date);
            Assert.AreEqual(result.Base, "USD");
        }