Esempio n. 1
0
        // GET: Movies/Details/5
        public ActionResult Details(Guid?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Movie movie = moviesService.GetMovieById(id);

            if (movie == null)
            {
                return(HttpNotFound());
            }
            return(View(movie));
        }
Esempio n. 2
0
        public void ReturnMovieIfGetDeleteIsFalseAndMovieIsNotDeleted()
        {
            //Arrange
            var guid      = Guid.NewGuid();
            var testMovie = new Movies()
            {
                Id        = Guid.NewGuid(),
                IsDeleted = false
            };

            movies.Setup(x => x.GetById(It.IsAny <Guid>())).Returns(testMovie);
            var sut = new MoviesService(movies.Object, genresRepo.Object, commentsRepo.Object, userRepo.Object, likesRepo.Object, dislikesRepo.Object, saver.Object);

            //Act
            var result = sut.GetMovieById(testMovie.Id, false);

            //Assert
            Assert.AreEqual(result.Id, testMovie.Id);
        }