public void InterestRateController_ShoulReturnInterestRate() { InterestRateService interestRateService = new InterestRateService(); var result = interestRateService.GetInterestRate(); Assert.Contains($"0,01", result); }
public void InterestRateController_ShoulNotReturnEmptyOrNullValue() { InterestRateService interestRateService = new InterestRateService(); var result = interestRateService.GetInterestRate(); Assert.NotNull(result.ToString()); Assert.NotEmpty(result.ToString()); }
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(); }
public IActionResult GetInterestRate() { return(Ok(interestRateService.GetInterestRate())); }