Example #1
0
        public void MockCanLoadByDirectior()
        {
            var    repo         = new DvdRepositoryMock();
            string directorName = "Mock Director";
            var    dvds         = repo.GetByDirector(directorName);

            Assert.AreEqual(1, dvds.Count());
        }
Example #2
0
        public void CanGetByDirector(string director, bool expected)
        {
            DvdRepositoryMock repo = new DvdRepositoryMock();

            List <Dvd> result = repo.GetByDirector(director);

            bool actual;

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

            Assert.AreEqual(expected, actual);
        }