public ActionResult Create([Bind(Include = "Id,DataInicio,DataFim,AmigoId,DataCadastro,Ativo")] Emprestimo emprestimo)
        {
            try
            {
                var jogos = GetJogosFromRequest();

                if (_validation.IsValid(emprestimo) &&
                    _validation.ValidarJogosParaEmprestimo(jogos)) //<== verificar esta validacao

                {
                    IncluirJogosParaEmprestimo(emprestimo, jogos);
                    MudarDisponiblidadeDosJogos(db, jogos);

                    db.Emprestimos.Add(emprestimo);
                    db.SaveChanges();
                    return(RedirectToAction("Index"));
                }
            }
            catch (Exception ex)
            {
                ViewBag.Error = ex.Message;
            }
            ViewBag.AmigoId = new SelectList(db.Amigos.Where(a => a.Ativo), "Id", "Nome");
            ViewBag.Jogos   = new SelectList(db.Jogos.Where(j => j.Ativo && j.Disponivel), "Id", "Nome");
            return(View(emprestimo));
        }
        public void DeveraFalhar_SeAlgumaPropriedadeDoObjejto_Invalida()
        {
            var expected = new Exception();
            var result   = validation.IsValid(EmprestimoMock.EmprestimoDemoInvalido());

            Assert.AreEqual(expected, result);
        }