예제 #1
0
        public void ADOCanUpdate(int id, string title, int releaseYear, string rating, string director, string notes, bool expected)
        {
            bool actual = false;

            Dvd dvd = new Dvd
            {
                DvdId       = id,
                Title       = title,
                ReleaseYear = releaseYear,
                Rating      = rating,
                Director    = director,
                Notes       = notes
            };
            var repo = new DvdRepositoryADO();

            Dvd dvdCheck = repo.Get(id);

            if (dvdCheck != null)
            {
                repo.Update(dvd);
                dvdCheck = repo.Get(id);
                if (dvdCheck.Title == "Test")
                {
                    actual = true;
                }
            }

            Assert.AreEqual(expected, actual);
        }
예제 #2
0
        public void ADOCanDelete(int id, bool expected)
        {
            bool actual = false;

            var repo = new DvdRepositoryADO();
            Dvd dvd  = repo.Get(id);

            if (dvd != null)
            {
                repo.Delete(id);


                dvd = repo.Get(id);

                if (dvd == null)
                {
                    actual = true;
                }
            }
            Assert.AreEqual(expected, actual);
        }
예제 #3
0
        public void ADOGetTest(int id, bool expected)
        {
            var repo = new DvdRepositoryADO();
            Dvd dvd  = repo.Get(id);

            bool actual = false;

            if (dvd != null)
            {
                actual = true;
            }

            Assert.AreEqual(expected, actual);
        }