public ActionResult EditMovie(int id) { _movieServices = new MovieServices(); var model = _movieServices.GetMovieById(id); return(View(model)); }
public ActionResult AddGenre(int id) { _movieServices = new MovieServices(); var model = _movieServices.GetMovieById(id); var genreModel = new GenreModel(); RedirectToAction("AddGenre", "Movie", new { movieModel = model, genreModel = genreModel }); return(View(genreModel)); }
public void GetMovieById_Should_GetCorrectMovie() { var db = new TFContext(DatabaseSimulator()); var genreServiceMock = new Mock <IGenreServices>(); var movieService = new MovieServices(db, genreServiceMock.Object); var movie = new Movie() { Id = 1, Title = "TheMovie" }; db.Movies.Add(movie); db.SaveChanges(); string movieTitle = movieService.GetMovieById(1).Title; Assert.AreEqual("TheMovie", movieTitle); }