Exemplo n.º 1
0
        public void ADOGetDvdByDirector()
        {
            var    repo     = new DvdRepositoryADO();
            string director = "John";
            var    dvd      = repo.GetByDirector(director);

            Assert.AreEqual(1, dvd.Count());

            Assert.AreEqual(2, dvd[0].DvdId);
            Assert.AreEqual("That old movie", dvd[0].Title);
            Assert.AreEqual(1444, dvd[0].ReleaseYear);
            Assert.AreEqual("John", dvd[0].Director);
            Assert.AreEqual("PG-13", dvd[0].Rating);
            Assert.AreEqual("Movie did not age well", dvd[0].Notes);
        }
        public void CanGetByDirector(string director, bool expected)
        {
            DvdRepositoryADO repo = new DvdRepositoryADO();

            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);
        }