Esempio n. 1
0
        public void ADOGetDvdByTitle()
        {
            var    repo  = new DvdRepositoryADO();
            string title = "That other movie";
            var    dvd   = repo.GetByTitle(title);

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

            Assert.AreEqual(3, dvd[0].DvdId);
            Assert.AreEqual("That other movie", dvd[0].Title);
            Assert.AreEqual(2030, dvd[0].ReleaseYear);
            Assert.AreEqual("Jacob", dvd[0].Director);
            Assert.AreEqual("R", dvd[0].Rating);
            Assert.AreEqual("A ways off", dvd[0].Notes);
        }
        public void CanGetByTitle(string title, bool expected)
        {
            DvdRepositoryADO repo = new DvdRepositoryADO();

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