public void deleteCustomerOkTest() { Mock <ICustomerDomainService> mock = new Mock <ICustomerDomainService>(); mock.Setup(x => x.DeleteCustomer(It.IsAny <TSeg_Clientes>())).Returns(1); CustomerApplicationService test = new CustomerApplicationService(mock.Object); var response = test.DeleteCustomer(1); Assert.IsTrue(response > 0); }
public ActionResult Delete(long id) { long response = CustomerApplicationService.DeleteCustomer(id); if (response > 0) { return(RedirectToAction("Customers")); } else { ViewBag.Error = "El cliente no pudo ser eliminado."; return(View("~/Views/Customers/Customers.cshtml")); } }
public IHttpActionResult DeleteCustomer(int id) { _service.DeleteCustomer(id); return(Ok()); }