Skip to content

Commit

Permalink
Removendo caractere especial dos testes
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas229 committed Jul 1, 2023
1 parent 70453eb commit bc7f474
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/UsuarioServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ public void CadastrarUsuarioDnit_QuandoUsuarioDnitJaExistenteForPassado_DeveLanc
Mock<IEmailService> emailService = new();

mapper.Setup(x => x.Map<UsuarioDnit>(It.IsAny<UsuarioDTO>())).Returns(usuarioDNIT);
usuarioRepositorio.Setup(x => x.CadastrarUsuarioDnit(It.IsAny<UsuarioDnit>())).Throws(new InvalidOperationException("Email j� cadastrado."));
usuarioRepositorio.Setup(x => x.CadastrarUsuarioDnit(It.IsAny<UsuarioDnit>())).Throws(new InvalidOperationException("Email cadastrado."));

IUsuarioService usuarioService = new UsuarioService(usuarioRepositorio.Object, mapper.Object, emailService.Object);

Action cadastrarUsuario = () => usuarioService.CadastrarUsuarioDnit(usuarioStub.RetornarUsuarioDnitDTO());

Exception exception = Assert.Throws<InvalidOperationException>(cadastrarUsuario);

Assert.Equal("Email j� cadastrado.", exception.Message);
Assert.Equal("Email cadastrado.", exception.Message);
}

[Fact]
Expand All @@ -96,15 +96,15 @@ public void CadastrarUsuarioTerceiro_QuandoUsuarioTerceiroJaExistenteForPassado_
Mock<IEmailService> emailService = new();

mapper.Setup(x => x.Map<UsuarioTerceiro>(It.IsAny<UsuarioDTO>())).Returns(usuarioTerceiro);
usuarioRepositorio.Setup(x => x.CadastrarUsuarioTerceiro(It.IsAny<UsuarioTerceiro>())).Throws(new InvalidOperationException("Email j� cadastrado."));
usuarioRepositorio.Setup(x => x.CadastrarUsuarioTerceiro(It.IsAny<UsuarioTerceiro>())).Throws(new InvalidOperationException("Email cadastrado."));

IUsuarioService usuarioService = new UsuarioService(usuarioRepositorio.Object, mapper.Object, emailService.Object);

Action cadastrarUsuario = () => usuarioService.CadastrarUsuarioTerceiro(usuarioStub.RetornarUsuarioTerceiroDTO());

Exception exception = Assert.Throws<InvalidOperationException>(cadastrarUsuario);

Assert.Equal("Email j� cadastrado.", exception.Message);
Assert.Equal("Email cadastrado.", exception.Message);
}

[Fact]
Expand Down Expand Up @@ -274,4 +274,4 @@ public void TrocaSenha_QuandoUuidNaoForValido_DeveLancarException()
usuarioRepositorio.Verify(x => x.RemoverUuidRedefinicaoSenha(It.IsAny<string>()), Times.Never);
}
}
}
}

0 comments on commit bc7f474

Please sign in to comment.