示例#1
0
        public ActionResult Delete_POST(MediaFile file)
        {
            int categoryId = file.MediaCategory.Id;

            _fileService.DeleteFile(file);
            return(RedirectToAction("Show", "MediaCategory", new { Id = categoryId }));
        }
示例#2
0
        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();
        }