Ejemplo n.º 1
0
        public void MockCanLoadByRating()
        {
            var    repo   = new DvdRepositoryMock();
            string rating = "NR";
            var    dvds   = repo.GetByRating(rating);

            Assert.AreEqual(1, dvds.Count());
        }
Ejemplo n.º 2
0
        public void CanGetByRating(string rating, bool expected)
        {
            DvdRepositoryMock repo = new DvdRepositoryMock();

            List <Dvd> result = repo.GetByRating(rating);

            bool actual;

            if (result.Count == 0)
            {
                actual = false;
            }
            else
            {
                actual = result.All(d => d.Rating == rating);
            }

            Assert.AreEqual(expected, actual);
        }