public async Task <IActionResult> GetJuros()
        {
            TaxaJurosService taxaJurosService = new TaxaJurosService();
            var txJuros = await taxaJurosService.RetornaTaxaJuros();

            return(new JsonResult(txJuros));
        }
        public TaxaJurosServiceUnitTest()
        {
            _mockHtppHandler = new Mock <HttpMessageHandler>();
            var httpClient = new HttpClient(_mockHtppHandler.Object);

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

            var taxajuros = taxaJurosService.ObterTaxaJuros();

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

            decimal valor = 0.01m;

            Assert.Equal(taxaJurosService.GetTaxaJuros().Result, valor);
        }
        public void TestTaxaJuros()
        {
            decimal decToCompare = 0.01m;

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

            Assert.AreEqual(decToCompare, decResultado);
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #8
0
 public TaxaJurosServiceUnitTest()
 {
     _service = new TaxaJurosService();
 }
        public IActionResult Get([FromServices] TaxaJurosService taxaJurosService)
        {
            var taxaJuros = taxaJurosService.ObterTaxaJuros();

            return(new OkObjectResult(taxaJuros.ToString()));
        }
 public DefaultFixtures()
 {
     this.TaxaJurosService = new TaxaJurosService();
 }
 public TaxaJurosServiceTests()
 {
     _taxaJurosService = new TaxaJurosService();
 }
Beispiel #12
0
        public void GetTaxaJuros_RetornaDecimal()
        {
            var taxaJurosService = new TaxaJurosService(new TaxaJurosRepository());

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