Exemple #1
0
        public ActionResult EditMovie(int id)
        {
            _movieServices = new MovieServices();
            var model = _movieServices.GetMovieById(id);

            return(View(model));
        }
Exemple #2
0
        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));
        }
Exemple #3
0
        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);
        }