public async Task Login_AoRealizarLoginComComandoInvalido_RetornarNotificacoesComFalha() { // Arrange var command = new LoginUsuarioCommand("", ""); // Act var responseResult = await _handler.Handle(command, CancellationToken.None); // Assert Assert.True(responseResult.HasFails); }
public void Erro_ao_efetuar_login_com_email_nao_cadastrado() { var cmd = new LoginUsuarioCommand("*****@*****.**", "123456"); var hdl = new LoginUsuarioHandler(_repositorio.Object); var result = (ResponseCommandResult)hdl.Handle(cmd); Assert.IsTrue(!result.Valid, result.Message); }
public void Erro_ao_efetuar_login_com_senha_invalida() { var cmd = new LoginUsuarioCommand("*****@*****.**", "123456"); _repositorio.Setup(x => x.ObterEntidade(It.IsAny <Expression <Func <Dominio.Entidades.Usuario, bool> > >())) .Returns(new Dominio.Entidades.Usuario("fulano xpto", cmd.Email, "5684582", "candidato", false)); var hdl = new LoginUsuarioHandler(_repositorio.Object); var result = (ResponseCommandResult)hdl.Handle(cmd); Assert.IsTrue(!result.Valid, result.Message); }