public async Task GetTaxaJuros_BadRequest() { mockTaxaService.Setup(taxa => taxa.ObterTaxaJuros()).ReturnsAsync(decimal.Zero); TaxaController taxaController = new TaxaController(mockTaxaService.Object); var result = await taxaController.GetTaxaJuros(); Assert.IsInstanceOf <BadRequestObjectResult>(result); }
public async Task GetTaxaJuros_Accepted() { mockTaxaService.Setup(taxa => taxa.ObterTaxaJuros()).ReturnsAsync(new decimal(0.01)); TaxaController taxaController = new TaxaController(mockTaxaService.Object); var result = await taxaController.GetTaxaJuros(); Assert.IsInstanceOf <AcceptedResult>(result); }
public async Task GetTaxaJuros_ModelStateInvalid() { TaxaController taxaController = new TaxaController(mockTaxaService.Object); taxaController.ModelState.AddModelError("Key", "errorMessage"); var result = await taxaController.GetTaxaJuros(); Assert.IsFalse(taxaController.ModelState.IsValid); Assert.IsInstanceOf <BadRequestObjectResult>(result); }