コード例 #1
0
        public async Task <IActionResult> GetJuros()
        {
            TaxaJurosService taxaJurosService = new TaxaJurosService();
            var txJuros = await taxaJurosService.RetornaTaxaJuros();

            return(new JsonResult(txJuros));
        }
コード例 #2
0
        public TaxaJurosServiceUnitTest()
        {
            _mockHtppHandler = new Mock <HttpMessageHandler>();
            var httpClient = new HttpClient(_mockHtppHandler.Object);

            _service = new TaxaJurosService(new Uri(_baseEndpoint), httpClient);
        }
コード例 #3
0
        public void TaxaJurosController_ObterTaxaJuros_Sucesso()
        {
            TaxaJurosService taxaJurosService = new TaxaJurosService();

            var taxajuros = taxaJurosService.ObterTaxaJuros();

            Assert.Contains($"0,01", taxajuros.ToString());
        }
コード例 #4
0
        public void GetTaxaJuros_E_Igual_1Porcento()
        {
            var taxaJurosService = new TaxaJurosService(new TaxaJurosRepository());

            decimal valor = 0.01m;

            Assert.Equal(taxaJurosService.GetTaxaJuros().Result, valor);
        }
コード例 #5
0
        public void TestTaxaJuros()
        {
            decimal decToCompare = 0.01m;

            TaxaJurosService objTaxaJurosService = new TaxaJurosService(new TaxaJurosRepository());
            decimal          decResultado        = objTaxaJurosService.GetTaxaJuros().ValorTaxa;

            Assert.AreEqual(decToCompare, decResultado);
        }
コード例 #6
0
        public async Task ReturnsCorrectValue(decimal valor)
        {
            var options = OptionsHelper.CreateOptionSnapshotMock(new TaxaJurosOptions {
                Valor = valor
            });
            var sut = new TaxaJurosService(options);

            decimal result = await sut.GetTaxaAtual();

            result.Should().Be(valor);
        }
コード例 #7
0
        public void Result_Should_Be_Equal()
        {
            //Arrange
            var service  = new TaxaJurosService();
            var esperado = 0.01m;

            //Act
            var resultado = service.ObterTaxaJuros();

            //Assert
            Assert.AreEqual(esperado, resultado);
        }
コード例 #8
0
 public TaxaJurosServiceUnitTest()
 {
     _service = new TaxaJurosService();
 }
コード例 #9
0
        public IActionResult Get([FromServices] TaxaJurosService taxaJurosService)
        {
            var taxaJuros = taxaJurosService.ObterTaxaJuros();

            return(new OkObjectResult(taxaJuros.ToString()));
        }
コード例 #10
0
 public DefaultFixtures()
 {
     this.TaxaJurosService = new TaxaJurosService();
 }
コード例 #11
0
 public TaxaJurosServiceTests()
 {
     _taxaJurosService = new TaxaJurosService();
 }
コード例 #12
0
        public void GetTaxaJuros_RetornaDecimal()
        {
            var taxaJurosService = new TaxaJurosService(new TaxaJurosRepository());

            Assert.IsType <Task <decimal> >(taxaJurosService.GetTaxaJuros());
        }
コード例 #13
0
 public TaxaJurosServiceTests()
 {
     _repository = Substitute.For <ITaxaJurosRepository>();
     _service    = new TaxaJurosService(_repository);
 }
コード例 #14
0
 public TaxaJurosAppServiceTests()
 {
     _taxaJurosService    = new TaxaJurosService();
     _taxaJurosAppService = new TaxaJurosAppService(_taxaJurosService);
 }