public void It_Should_Count_Movies()
        {
            var movieContext = new MoviesContextMock(new List<Movie> {new Movie(), new Movie()});
              const int expectedCount = 2;

              var actualCount = movieContext.GetNumberOfMovies();

              Assert.AreEqual(expectedCount, actualCount);
        }
        public void It_Should_Find_Movie_By_Id()
        {
            var movie = new Movie {Id = 1, Title = "One"};
              var movieContextMock = new MoviesContextMock(new List<Movie> {movie});

              var result = movieContextMock.GetMovie(movie.Id);

              Assert.AreEqual(movie, result);
        }
        public void It_Should_Search_Movies_By_Title()
        {
            var movieTitle = "Title";
              var expectedMovie = new Movie {Title = movieTitle};
              var movieContext = new MoviesContextMock(new List<Movie> {expectedMovie});

              var result = movieContext.SearchMovie(movieTitle);

              Assert.AreEqual(expectedMovie, result.ToList()[0]);
        }
        public void Title_Search_Should_Recognise_Partial_Matches()
        {
            var movieTitle = "The Title 44";
              var expectedMovie = new Movie {Title = movieTitle};
              var movieContext = new MoviesContextMock(new List<Movie> {expectedMovie});

              var result = movieContext.SearchMovie("Title").ToList();

              Assert.AreEqual(1, result.Count());
              Assert.AreEqual(expectedMovie, result[0]);
        }
        public void Title_Search_Should_Be_Case_Insensitive()
        {
            var movieTitle = "The Title 44";
              var expectedMovie = new Movie {Title = movieTitle};
              var movieContext = new MoviesContextMock(new List<Movie> {expectedMovie});

              var result = movieContext.SearchMovie("tITLE").ToList();

              Assert.AreEqual(1, result.Count());
              Assert.AreEqual(expectedMovie, result[0]);
        }
        public void It_Should_Count_Movies()
        {
            var movieContext = new MoviesContextMock(new List <Movie> {
                new Movie(), new Movie()
            });
            const int expectedCount = 2;

            var actualCount = movieContext.GetNumberOfMovies();

            Assert.AreEqual(expectedCount, actualCount);
        }
        public void It_Should_Add_Movies()
        {
            var movieToAdd = new Movie {Title = "robocop"};
              var movieContextMock = new MoviesContextMock(new List<Movie>());

              movieContextMock.AddMovie(movieToAdd);
              int actualCount = movieContextMock.GetNumberOfMovies();

              Assert.AreEqual(1, actualCount);
              Assert.AreEqual("robocop", movieContextMock.Movies.ToList()[0].Title);
        }
        public void It_Should_Find_Movie_By_Id()
        {
            var movie = new Movie {
                Id = 1, Title = "One"
            };
            var movieContextMock = new MoviesContextMock(new List <Movie> {
                movie
            });

            var result = movieContextMock.GetMovie(movie.Id);

            Assert.AreEqual(movie, result);
        }
        public void It_Should_Add_Movies()
        {
            var movieToAdd = new Movie {
                Title = "robocop"
            };
            var movieContextMock = new MoviesContextMock(new List <Movie>());

            movieContextMock.AddMovie(movieToAdd);
            int actualCount = movieContextMock.GetNumberOfMovies();

            Assert.AreEqual(1, actualCount);
            Assert.AreEqual("robocop", movieContextMock.Movies.ToList()[0].Title);
        }
        public void It_Should_Search_Movies_By_Title()
        {
            var movieTitle    = "Title";
            var expectedMovie = new Movie {
                Title = movieTitle
            };
            var movieContext = new MoviesContextMock(new List <Movie> {
                expectedMovie
            });


            var result = movieContext.SearchMovie(movieTitle);

            Assert.AreEqual(expectedMovie, result.ToList()[0]);
        }
        public void Title_Search_Should_Be_Case_Insensitive()
        {
            var movieTitle    = "The Title 44";
            var expectedMovie = new Movie {
                Title = movieTitle
            };
            var movieContext = new MoviesContextMock(new List <Movie> {
                expectedMovie
            });


            var result = movieContext.SearchMovie("tITLE").ToList();

            Assert.AreEqual(1, result.Count());
            Assert.AreEqual(expectedMovie, result[0]);
        }
        public void Title_Search_Should_Recognise_Partial_Matches()
        {
            var movieTitle    = "The Title 44";
            var expectedMovie = new Movie {
                Title = movieTitle
            };
            var movieContext = new MoviesContextMock(new List <Movie> {
                expectedMovie
            });


            var result = movieContext.SearchMovie("Title").ToList();

            Assert.AreEqual(1, result.Count());
            Assert.AreEqual(expectedMovie, result[0]);
        }