Exemple #1
0
        public void MockCanLoadByYear()
        {
            var repo        = new DvdRepositoryMock();
            int releaseYear = 2020;
            var dvds        = repo.GetByYear(releaseYear);

            Assert.AreEqual(1, dvds.Count());
        }
Exemple #2
0
        public void CanGetByYear(int year, bool expected)
        {
            DvdRepositoryMock repo = new DvdRepositoryMock();

            List <Dvd> result = repo.GetByYear(year);

            bool actual;

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

            Assert.AreEqual(expected, actual);
        }