Example #1
0
        public void InterestRateController_ShoulReturnInterestRate()
        {
            InterestRateService interestRateService = new InterestRateService();

            var result = interestRateService.GetInterestRate();

            Assert.Contains($"0,01", result);
        }
Example #2
0
        public void InterestRateController_ShoulNotReturnEmptyOrNullValue()
        {
            InterestRateService interestRateService = new InterestRateService();

            var result = interestRateService.GetInterestRate();

            Assert.NotNull(result.ToString());
            Assert.NotEmpty(result.ToString());
        }
Example #3
0
        public async Task GetInterestRate_ShouldUseTheCorrectUrlAndReturnValueCorrectly()
        {
            var response = _fixture.Create <InterestRateRespose>();

            _httpRequestService
            .Setup(s => s.GetJsonAsync <InterestRateRespose>(_urlsConfig.InterestRateQueryUrl))
            .ReturnsAsync(response);

            var result = await _service.GetInterestRate();

            result.Should().Be(response.Rate);
            _httpRequestService.VerifyAll();
        }
Example #4
0
 public IActionResult GetInterestRate()
 {
     return(Ok(interestRateService.GetInterestRate()));
 }