Administrasjon.Controllers.AdminCustomerController.Delete C# (CSharp) Method

Delete() public method

public Delete ( int id ) : System.Web.Mvc.ActionResult
id int
return System.Web.Mvc.ActionResult
        public ActionResult Delete(int id)
        {
            if (_customerBLL.delete(id))
            {
                return RedirectToAction("AllCustomers");
            }
            else
            {
                return View();
            }
        }

Usage Example

        public void DeleteTestFalse()
        {
            //Arrange
            var controller = new AdminCustomerController(new CustomerBLL(new CustomerDALStub()), new LoggingBLL(new LoggingDALStub()));

            //Act
            var result = (ViewResult)controller.Delete(-1);
            //Assert
            Assert.AreEqual(result.ViewName, "");
        }
All Usage Examples Of Administrasjon.Controllers.AdminCustomerController::Delete