public ActionResult Delete_POST(MediaFile file) { int categoryId = file.MediaCategory.Id; _fileService.DeleteFile(file); return(RedirectToAction("Show", "MediaCategory", new { Id = categoryId })); }
public void FileController_Delete_CallsDeleteFileOnFileService() { FileController fileController = GetFileController(); var mediaFile = new MediaFile(); mediaFile.MediaCategory = new MediaCategory { Id = 1 }; fileController.Delete_POST(mediaFile); A.CallTo(() => fileAdminService.DeleteFile(mediaFile)).MustHaveHappened(); }