コード例 #1
0
        public async Task <ActionResult> Get()
        {
            await Task.Delay(1);

            InterestRateDTO interestRate = InterestRateService.Execute();

            return(Ok(interestRate));
        }
コード例 #2
0
        public async Task <ActionResult> Get(double valorinicial, int meses)
        {
            InterestRateAPIService         interestRateServiceApi     = new InterestRateAPIService();
            ShowInterestCalculationService InterestCalculationService = new ShowInterestCalculationService(interestRateServiceApi);
            InterestRateDTO interestRate = await InterestCalculationService.Execute(valorinicial, meses);

            return(Ok(interestRate));
        }
コード例 #3
0
        public async void Filled_url_field()
        {
            RestClient  client  = new RestClient("https://softplayer.azurewebsites.net/");
            RestRequest request = new RestRequest("api/v1/taxajuros", Method.GET);

            request.AddHeader("Content-Type", "application/json");
            var response = await client.ExecuteAsync <InterestRateDTO>(request);

            var expected = new InterestRateDTO {
                value = 0.01
            };

            response.StatusCode.Should().Be(200);
            expected.value.Should().Be(response.Data.value);
            expected.Should().BeEquivalentTo(response.Data);
        }