Exemple #1
0
        public void CanGetDvdsByDirector()
        {
            var repo = new DvdRepositoryADO();
            var dvds = repo.GetDvdByDirector("Some Guy");

            Assert.IsNotNull(dvds);
            Assert.AreEqual(1, dvds.Count());
            Assert.AreEqual("The Lion King", dvds[0].Title);
            Assert.AreEqual(1992, dvds[0].ReleaseYear);
            Assert.AreEqual("Some Guy", dvds[0].Director);
            Assert.AreEqual("PG", dvds[0].Rating);
            Assert.AreEqual("The best ever!", dvds[0].Notes);

            Dvd addToTest = new Dvd();

            addToTest.DvdId       = 3;
            addToTest.Title       = "BobbyBuilderBanks";
            addToTest.ReleaseYear = 2000;
            addToTest.Director    = "Some Guy";
            addToTest.Rating      = "X";
            addToTest.Notes       = null;
            repo.CreateDvd(addToTest);

            dvds = repo.GetDvdByDirector("Some Guy");
            Assert.AreEqual(2, dvds.Count());
        }