Пример #1
0
        public void MockCanLoadByTitle()
        {
            var    repo  = new DvdRepositoryMock();
            string title = "Mock Movie";
            var    dvds  = repo.GetByTitle(title);

            Assert.AreEqual(1, dvds.Count());
        }
Пример #2
0
        public void CanGetByTitle(string title, bool expected)
        {
            DvdRepositoryMock repo = new DvdRepositoryMock();

            List <Dvd> result = repo.GetByTitle(title);

            bool actual;

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

            Assert.AreEqual(expected, actual);
        }