public async Task RemoverUsuarioCommandHandler_AoEditarUmUsuario_ComSucesso() { var command = new RemoverUsuarioCommandBuilder().Builder(); Usuario usuario = new UsuarioBuilder().Builder(); usuarioRepositoryMock.BuscarAsync(Arg.Any <Guid>()).Returns(usuario); var result = await handler.Handle(command, new CancellationToken()) as EntityCommandResult; Assert.True(result.Success); }
public async Task RemoverUsuarioCommandHandler_AoEditarUmUsuario_ENaoExiste_DeveRetorno_QueTemUmProblema() { var command = new RemoverUsuarioCommandBuilder().Builder(); const string MESSAGE = "Usuário não encontrado"; Usuario usuario = null; usuarioRepositoryMock.BuscarAsync(Arg.Any <Guid>()).Returns(usuario); var result = await handler.Handle(command, new CancellationToken()) as EntityCommandResult; Assert.True(result.HasAProblem); Assert.Equal(MESSAGE, result.Message); }