From f8d2a08fb16ff3c2d5e044446477048cef181455 Mon Sep 17 00:00:00 2001 From: lucas229 Date: Thu, 29 Jun 2023 13:27:50 -0300 Subject: [PATCH] Adicionando testes do controller de dominio --- test/DominioControllerTest.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/DominioControllerTest.cs diff --git a/test/DominioControllerTest.cs b/test/DominioControllerTest.cs new file mode 100644 index 0000000..eb43c3d --- /dev/null +++ b/test/DominioControllerTest.cs @@ -0,0 +1,24 @@ +using app.Controllers; +using Microsoft.AspNetCore.Mvc; +using Moq; +using repositorio.Interfaces; +using Xunit; + +namespace test +{ + public class DominioControllerTest + { + [Fact] + public void ObterLista_QuandoMetodoForChamado_DeveRetornarListaDeUFs() + { + Mock usuarioFederativaRepositorioMock = new(); + + var controller = new DominioController(usuarioFederativaRepositorioMock.Object); + + var resultado = controller.ObterLista(); + + usuarioFederativaRepositorioMock.Verify(repo => repo.ObterDominio(), Times.Once); + Assert.IsType(resultado); + } + } +}