Ejemplo n.º 1
0
        public void MockCanDeleteDvd()
        {
            var repo = new DvdRepositoryMock();
            var test = repo.GetAllDvd();

            Assert.AreEqual(3, test.Count());
            repo.Delete(3);
            test = repo.GetAllDvd();

            Assert.AreEqual(2, test.Count());
        }
Ejemplo n.º 2
0
        public void CanDeleteDvd()
        {
            Dvd dvd  = new Dvd();
            var repo = new DvdRepositoryMock();

            repo.Delete(4);

            var dvds = repo.GetAll();

            Assert.AreEqual(13, dvds.Count());
            Assert.AreEqual(null, repo.GetById(4));
        }
Ejemplo n.º 3
0
        public void CanDeleteDvdMock()
        {
            Dvd dvdToAdd = new Dvd();
            var repo     = new DvdRepositoryMock();

            dvdToAdd.Title        = "My test Dvd";
            dvdToAdd.ReleaseYear  = 2020;
            dvdToAdd.DirectorName = "TestDirector";
            dvdToAdd.RatingName   = "R";
            dvdToAdd.Notes        = "Dvd for my test";

            repo.Insert(dvdToAdd);

            var loaded = repo.GetById(7);

            Assert.IsNotNull(loaded);

            repo.Delete(7);
            loaded = repo.GetById(7);

            Assert.IsNull(loaded);
        }