public void Get_currency_currencylayer_success(int cacheSeconds)
        {
            Singleton.AppSettings.CacheSeconds = cacheSeconds;

            var mock = new Mock <IHttpClient>();

            mock.Setup(x => x.GetBaseHttpTask <Currency>(Singleton.AppSettings.BaseUrl, "live", $"access_key={Singleton.AppSettings.Token}"))
            .Returns(new Currency {
                Success = true
            });
            var service = new CurrencyLayerService(mock.Object);

            service.ClearCache();

            var r1 = service.GetCurrency();

            service.GetCurrency();
            if (r1.Date >= DateTime.Now.AddSeconds(-cacheSeconds))
            {
                mock.Verify(x => x.GetBaseHttpTask <Currency>(Singleton.AppSettings.BaseUrl, "live", $"access_key={Singleton.AppSettings.Token}"), Times.Once);
            }
            else
            {
                mock.Verify(x => x.GetBaseHttpTask <Currency>(Singleton.AppSettings.BaseUrl, "live", $"access_key={Singleton.AppSettings.Token}"), Times.Exactly(2));
            }
        }
        public void Get_currency_currencylayer_ThrowsDataException_But_InCache()
        {
            Singleton.AppSettings.CacheSeconds = 0;

            var mock = new Mock <IHttpClient>();

            mock.Setup(x => x.GetBaseHttpTask <Currency>(Singleton.AppSettings.BaseUrl, "live", $"access_key={Singleton.AppSettings.Token}"))
            .Returns(new Currency {
                Success = true
            });

            var service = new CurrencyLayerService(mock.Object);

            service.ClearCache();

            var r1 = service.GetCurrency();

            mock.Setup(x => x.GetBaseHttpTask <Currency>(Singleton.AppSettings.BaseUrl, "live", $"access_key={Singleton.AppSettings.Token}"))
            .Returns(new Currency {
                Success = false
            });

            var r2 = service.GetCurrency();

            Assert.Equal(r1, r2);
        }