Beispiel #1
0
        public void Test_For_DeleteEntity_Valid(int testProjectId, bool expectedResult)
        {
            var testProjectToDelete = testingProjectRepo.GetById(testProjectId);
            var actualResult        = testingProjectRepo.Delete(testProjectToDelete);

            Assert.Equal(expectedResult, actualResult);
        }
        public bool Remove(int projId)
        {
            var projectToDelete = _projectRepo.GetById(projId);

            if (projectToDelete != null)
            {
                return(_projectRepo.Delete(projectToDelete));
            }
            else
            {
                return(false);
            }
        }
 public IActionResult DeleteConfirmed(int id)
 {
     _projects.Delete(id);
     return(RedirectToAction("Index"));
 }
Beispiel #4
0
 public ActionResult Delete(int id, Project project)
 {
     projectRepo.Delete(id);
     return(RedirectToAction("Index"));
 }
Beispiel #5
0
 public bool Remove(int projId)
 {
     return(_projectRepo.Delete(_projectRepo.GetById(projId)));
 }