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

            var result = interestRateService.GetInterestRate();

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

            var result = interestRateService.GetInterestRate();

            Assert.NotNull(result.ToString());
            Assert.NotEmpty(result.ToString());
        }
示例#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();
        }
示例#4
0
 public IActionResult GetInterestRate()
 {
     return(Ok(interestRateService.GetInterestRate()));
 }