public void TipoEnderecoIncluir() { // Arrange var tipo = new EnderecoTipoEndereco { Descricao = "COMERCIAL" }; // Act int id = service.Gravar(tipo); // Assert Assert.AreEqual(1, id); }
public ActionResult Edit([Bind(Include = "Id,Descricao,Ativo")] EnderecoTipoEndereco tipo) { try { if (ModelState.IsValid) { _service.Gravar(tipo); return(RedirectToAction("Index")); } return(View(tipo)); } catch (ArgumentException e) { ModelState.AddModelError(string.Empty, e.Message); return(View(tipo)); } }