public ActionResult Create() { IEnumerable <Aluguel> listarAlugueis = _aluguelService.ObterTodos(); ViewBag.IdAluguel = new SelectList(listarAlugueis, "CodigoAluguel", "Descricao", null); return(View()); }
public void InserirTest() { // Act _aluguelService.Inserir(new Aluguel { CodigoAluguel = 4, Descricao = "Aluguel novo", CodigoStatusPagamento = 1 }); // Assert Assert.AreEqual(4, _aluguelService.ObterTodos().Count()); var aluguel = _aluguelService.Buscar(4); Assert.AreEqual("Aluguel novo", aluguel.Descricao); Assert.AreEqual(1, aluguel.CodigoStatusPagamento); }
public ActionResult Index() { var listarAlugueis = _aluguelService.ObterTodos(); var listarAlugueisModel = _mapper.Map <List <AluguelModel> >(listarAlugueis); return(View(listarAlugueisModel)); }