Example #1
0
        public void CanGetDvdsByReleaseYear()
        {
            var repo = new DvdRepositoryADO();
            var dvds = repo.GetDvdByReleaseYear(2010);

            Assert.IsNotNull(dvds);
            Assert.AreEqual(1, dvds.Count());
            Assert.AreEqual("Up", dvds[0].Title);
            Assert.AreEqual(2010, dvds[0].ReleaseYear);
            Assert.AreEqual("PG", dvds[0].Rating);

            Dvd dvd = new Dvd();

            dvd.DvdId       = 3;
            dvd.Title       = "Training Day";
            dvd.ReleaseYear = 2010;
            dvd.Director    = "Joe Blow";
            dvd.Rating      = "R";
            dvd.Notes       = null;

            repo.CreateDvd(dvd);

            var x = repo.GetDvdByReleaseYear(2010);

            Assert.AreEqual(2, x.Count());
        }