Ejemplo n.º 1
0
        public void Should_AddAnMovie_WhenAddingAnMovie()
        {
            //Arrange
            MovieModel movie = new MovieModel {
                Id = 10, Name = "AddTest"
            };

            //Act
            movieLogic.AddMovie(movie);

            //Assert
            Assert.True(movieLogic.GetMovieById(10).Name == "AddTest");
        }
Ejemplo n.º 2
0
        public ActionResult MovieInfo(int id)
        {
            var movieModel = _movieLogic.GetMovieById(id, MiscHelper.GetCurrentUserIdOrZero(this));

            if (movieModel == null)
            {
                return(NotFound());
            }

            var movieViewModel = ModelToViewModel.ToMovieViewModel(movieModel);

            return(View(movieViewModel));
        }
Ejemplo n.º 3
0
        public void GetMovieById()
        {
            var expected = 1;
            var actual   = _movieLogic.GetMovieById(1, 0).MovieId;

            Assert.AreEqual(expected, actual);
        }
        public void Should_ReturnMovie_WhenGettingTheMovieById()
        {
            //Arrange
            //Id = 1010 and Name =

            //Act
            var Movie = movieLogic.GetMovieById(1010);

            //Assert
            Assert.True(Movie.Id == 1010 && Movie.Name == "GetByIdTest");
        }
        public IActionResult MovieDetails(Movie movie)
        {
            var movieDetails = new MovieDetailViewModel
            {
                AiringMovies = _movieLogic.GetAiringsFromMovieStartingFromDate(movie, DateTime.Today),
                Movie        = _movieLogic.GetMovieById(movie.Id),
                Reviews      = _movieLogic.GetAllReviewsFromMovie(movie)
            };

            foreach (var airingMovie in movieDetails.AiringMovies)
            {
                airingMovie.Movie = movie;
            }

            return(View(movieDetails));
        }