public void T4()
        {
            var gRating    = new MpaaRatingAtMostSpecification(MpaaRating.G);
            var goodMovie  = new GoodMovieSpecification();
            var repository = new MovieRepository();

            IReadOnlyList <Movie> movies = repository.Find(gRating.And(goodMovie));

            movies.Count.ShouldEqual(0);
        }
        public void T4()
        {
            var gRating = new MpaaRatingAtMostSpecification(MpaaRating.G);
            var goodMovie = new GoodMovieSpecification();
            var repository = new MovieRepository();

            IReadOnlyList<Movie> movies = repository.Find(gRating.And(goodMovie));

            movies.Count.ShouldEqual(0);
        }
        public void T1()
        {
            var movie      = new Movie("Some Movie", new DateTime(2010, 2, 1), MpaaRating.G, "Triller", 10);
            var pg13Rating = new MpaaRatingAtMostSpecification(MpaaRating.PG13);
            var goodMovie  = new GoodMovieSpecification();
            var composed   = pg13Rating.And(goodMovie);

            bool isSatisfiedBy = composed.IsSatisfiedBy(movie);

            isSatisfiedBy.ShouldEqual(true);
        }
Exemple #4
0
        public void UseAndComposition()
        {
            //-- Arrange
            var gRating    = new MpaaRatingAtMostSpecification(MpaaRating.G);
            var goodMovie  = new GoodMovieSpecification();
            var repository = new MovieRepository();

            //-- Act
            var movies = repository.Find(gRating.And(goodMovie));

            //-- Assert
            Assert.Single(movies);
        }