Exemplo n.º 1
0
        public IActionResult AddMovieToList(int movieId, int movieListId)
        {
            MovieListModel movieListModel = MovieListModelFromBO(movieListCollection.GetMovieList(movieListId));
            MovieListDTO   movieListDTO   = CreateMovieListDTOFromViewModel(movieListModel);
            MovieList      movieList      = new MovieList(movieListDTO);

            movieList.AddMovieToList(movieListDTO, movieId);
            return(RedirectToAction("EditMovieList", new { movieListId = movieListId }));
        }
Exemplo n.º 2
0
        public IActionResult CreateMovieList(MovieListModel movieListModel, string userName)
        {
            int userId = userCollection.GetUserIdByUName(userName);

            movieListModel.UserId = userId;
            MovieListDTO movieListDTO   = CreateMovieListDTOFromViewModel(movieListModel);
            MovieList    movielist      = new MovieList(movieListDTO);
            int          newMovieListId = movieListCollection.CreateMovieList(CreateMovieListDTOFromViewModel(movieListModel));

            movieListDTO.Id = newMovieListId;
            movielist.AddMovieToList(movieListDTO, 3009);
            return(RedirectToAction("Index", "MovieList", new { userName = userName }));
        }
Exemplo n.º 3
0
        public void Sort_Name_True() //sorts are all the same except for different fields
        {
            MovieList    movieList = new MovieList();
            List <Movie> movies    = new List <Movie>();

            movieList.InitializeMovieList();

            movieList.AddMovieToList("Pulp Fiction", "Samuel Jackson", "Crime", "Quentin Tarantino");

            movieList.MovieSortByName();

            movies = movieList.ReturnMovieList();

            Assert.Equal("Die Hard", movies[0].MovieName);
        }