public void ServicoRepositoryAddTest() { Servico servico = new Servico() { Cliente_ID = 1, Fornecedor_ID = 1, Data = DateTime.Now, Descricao = "Manutenção", TipoServico = Enum.TipoServico.ServicosGerais, Valor = 100 }; ServicoRepository servicoRepository = new ServicoRepository(); servicoRepository.Add(servico); Assert.IsNotNull(servico.Id); servicoRepository.Delete(servico.Id); }
public ActionResult DeleteConfirmed(int id) { _servicoRepository.Delete(id); return(RedirectToAction("Index")); }