public void CalcularJurosUmPorcento_100000_100(decimal valorInicial, int meses) { var calculaJurosService = new CalculaJurosService(); var result = calculaJurosService.CalcularUmPorcentoMeses(new Valores() { ValorInicial = valorInicial, Meses = meses }); Assert.Equal(270481.38M, result.Resultado); }
public void Tempo_Menor_Que_Zero() { var httpClientFactoryMock = Substitute.For <IHttpClientFactory>(); var calculaJurosService = new CalculaJurosService(httpClientFactoryMock); var valorInicial = 100.00m; var tempo = -5; Assert.ThrowsAsync <Exception>(() => calculaJurosService.CalculaJurosAsync(valorInicial, tempo)); }
public void CalculaJuros_Retorna_Decimal() { var httpClientFactoryMock = Substitute.For <IHttpClientFactory>(); var calculaJurosService = new CalculaJurosService(httpClientFactoryMock); var valorInicial = 100.00m; var tempo = 5; Assert.IsType <Task <decimal> >(calculaJurosService.CalculaJurosAsync(valorInicial, tempo)); }
public async Task Result_Should_Be_GreaterThan() { //Arrange var valorInicial = 200m; var meses = 7; var service = new CalculaJurosService(_httpClient, _settings); //Act var valorFinal = await service.CalcularJuros(valorInicial, meses); //Assert Assert.IsTrue(valorFinal > 0); }
public async Task TestCalculaJuros() { decimal decValorInicial = 100m; int intMeses = 5; decimal decToCompare = 105.10m; CalculaJurosService objCalculaJurosService = new CalculaJurosService(objClient, objConfig); decimal decResultado = await objCalculaJurosService.CalcularJuros(new CalculaJuros() { ValorEntrada = decValorInicial, Meses = intMeses }); Assert.AreEqual(decToCompare, decResultado); }
public async Task Result_Should_Be_Zero() { //Arrange var valorInicial = 0m; var meses = 5; var esperado = 0; var service = new CalculaJurosService(_httpClient, _settings); //Act var valorFinal = await service.CalcularJuros(valorInicial, meses); //Assert Assert.AreEqual(esperado, valorFinal); }
public async void DeveCalcularJurosCompostosCorretamente( decimal taxaJuros, decimal valorInicial, int meses, decimal jurosEsperado ) { var taxaJurosApiService = A.Fake <ITaxaJurosApiService>(); A.CallTo(() => taxaJurosApiService.ObterTaxaJuros(A <CancellationToken> .Ignored)) .Returns(taxaJuros); var service = new CalculaJurosService(taxaJurosApiService); var jurosComposto = await service.CalcularJurosComposto(valorInicial, meses, default(CancellationToken)); Assert.Equal(jurosEsperado, jurosComposto); }
public CalculaJurosServiceUnitTest() { _service = new CalculaJurosService(); }
public CalculaJurosController() { _calc = new CalculaJurosService(); }
public CalcularJurosServiceTests() { _taxaJurosService.Setup(x => x.ObterAsync()).Returns(Task.FromResult(0.01m)); _calculaJurosService = new CalculaJurosService(_taxaJurosService.Object); }
public TesteController() { _jurosService = new CalculaJurosService(); }
public CalculaJurosTests() { _taxaJurosServiceMock = new Mock <ITaxaJurosService>(); _service = new CalculaJurosService(_taxaJurosServiceMock.Object); }
public CalculaJurosServiceUnitTest() { _mockTaxaJurosService = new Mock <ITaxaJurosService>(); _service = new CalculaJurosService(_mockTaxaJurosService.Object); }