public void deletePolicyOkTest() { Mock <IPolicyDomainService> mock = new Mock <IPolicyDomainService>(); mock.Setup(x => x.DeletePolicy(It.IsAny <TSeg_Polizas>())).Returns(1); PolicyApplicationService test = new PolicyApplicationService(mock.Object); var response = test.DeletePolicy(1); Assert.IsTrue(response > 0); }
public ActionResult Delete(long id) { long response = PolicyApplicationService.DeletePolicy(id); if (response > 0) { return(RedirectToAction("Policies")); } else { ViewBag.Error = "El cliente no pudo ser eliminado."; return(View("~/Views/Policies/Policies.cshtml")); } }