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

            var result = repo.GetAllDVDs();

            Assert.AreEqual(result.Count, 3);
        }
Пример #2
0
        public void GetActorDetailsTest()
        {
            var repo = new DVDMockRepo();

            int dvdID = 1;

            var result = repo.GetActorDetails(dvdID);

            Assert.AreEqual(result.Count, 2);
        }
Пример #3
0
        public void AddDVDTest()
        {
            var repo = new DVDMockRepo();

            var dvd = new DVD()
            {
                Title = "Test",
                ReleaseDate = new DateTime(2015, 10, 19),
                MPAA = "R",
                Director = "Mr. Test",
                StudioID = 1
            };

            int dvdId = repo.AddDVD(dvd);

            Assert.AreEqual(DVDMockRepo._dvds.Count, 4);
            Assert.AreEqual(DVDMockRepo._dvds[3].Title, "Test");
        }
Пример #4
0
        public void GetAllMPAATest()
        {
            var repo = new DVDMockRepo();

            var result = repo.GetAllMPAA();

            Assert.AreEqual(result.Count, 5);
        }
Пример #5
0
        public void RemoveDVDTest()
        {
            var repo = new DVDMockRepo();

            int dvdId = 1;

            repo.RemoveDVD(dvdId);

            Assert.AreEqual(DVDMockRepo._dvds.Count, 2);
        }
Пример #6
0
        public void GetDVDByTitleTest()
        {
            var repo = new DVDMockRepo();

            string title = "Happy Gilmore";

            var result = repo.GetDVDByTitle(title);

            Assert.AreEqual(result.Count, 1);
            Assert.AreNotEqual(result[0].Title, "Happy Days");
        }
Пример #7
0
        public void GetDVDByIdTest()
        {
            var repo = new DVDMockRepo();

            int dvdID = 1;

            var result = repo.GetDVDById(dvdID);

            Assert.AreEqual(result.Title, "Talladega Nights");
        }