Пример #1
0
        public void AddDvd()
        {
            var repo = new MockDvdRepository();

            //var preAdd = repo.GetAll();

            Dvd dvdAdd = new Dvd();

            dvdAdd.Title        = "Making the Band";
            dvdAdd.ReleaseYear  = 2000;
            dvdAdd.DirectorName = "Dylan";
            dvdAdd.RatingType   = "PG";
            dvdAdd.Notes        = "I spit hot fire!";

            repo.AddDvd(dvdAdd);

            //var postAdd = repo.GetAll();
            //Assert.AreEqual(preAdd.Count + 1, postAdd.Count);

            var dvd = repo.GetDvdById(4);

            Assert.AreEqual("Making the Band", dvd.Title);
            Assert.AreEqual(2000, dvd.ReleaseYear);
            Assert.AreEqual("Dylan", dvd.DirectorName);
            Assert.AreEqual("PG", dvd.RatingType);
            Assert.AreEqual("I spit hot fire!", dvd.Notes);
        }
Пример #2
0
        public void GetDvdById()
        {
            var repo = new MockDvdRepository();

            var dvd = repo.GetDvdById(2);

            Assert.AreEqual(2, dvd.DvdId);
        }
Пример #3
0
        public void EditDvd()
        {
            var repo = new MockDvdRepository();

            Dvd editDvd = new Dvd();

            editDvd.DvdId        = 4;
            editDvd.Title        = "When Keeping It Real Goes Wrong";
            editDvd.ReleaseYear  = 2013;
            editDvd.DirectorName = "Tyrone Biggums";
            editDvd.RatingType   = "G";
            editDvd.Notes        = "It always goes wrong.";

            repo.EditDvd(editDvd);

            var dvdToEdit = repo.GetDvdById(4);

            Assert.AreEqual("Tyrone Biggums", dvdToEdit.DirectorName);
        }