Beispiel #1
0
        public void Given_Currency_When_GetLatestInvoked_Then_resultWithExchangeRatesCollectionRetrived()
        {
            var currency = "USD";

            var result = _serviceUnderTest.GetLatest(currency);

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Any());
        }
        public IActionResult GetLatest(string currency)
        {
            var actionResponse = GetEmptyResponseBuilder <IEnumerable <ExchangeRate> >();

            try
            {
                actionResponse.SetData(_exchangeRateService.GetLatest(currency));

                return(Ok(actionResponse));
            }
            catch (Exception ex)
            {
                return(Ko(actionResponse, ex));
            }
        }