public void Delete_GivenSongWasNotDeleted_Should_ReturnNotFound() { _songService.Delete(Arg.Any <Guid>()).Returns(false); var actionResult = _songsController.Delete(Guid.NewGuid()); Assert.IsType <NotFoundResult>(actionResult.Result); }
public IActionResult RemoveSong(int id) { Song song = (from s in repository.GetAllSongs() where s.SongID == id select s).FirstOrDefault <Song>(); repository.Delete(song); return(RedirectToAction("AllSongs", "Music")); }