示例#1
0
        public void GetAllStudiosTest()
        {
            var repo = new DVDMockRepo();

            var result = repo.GetAllStudios();

            Assert.AreEqual(result.Count, 3);
        }
示例#2
0
        public void GetAllMPAATest()
        {
            var repo = new DVDMockRepo();

            var result = repo.GetAllMPAA();

            Assert.AreEqual(result.Count, 5);
        }
示例#3
0
        public void RemoveDVDTest()
        {
            var repo = new DVDMockRepo();

            int dvdId = 1;

            repo.RemoveDVD(dvdId);

            Assert.AreEqual(DVDMockRepo._dvds.Count, 2);
        }
示例#4
0
        public void GetDVDByIdTest()
        {
            var repo = new DVDMockRepo();

            int dvdID = 1;

            var result = repo.GetDVDById(dvdID);

            Assert.AreEqual(result.Title, "Talladega Nights");
        }
示例#5
0
        public void GetActorDetailsTest()
        {
            var repo = new DVDMockRepo();

            int dvdID = 1;

            var result = repo.GetActorDetails(dvdID);

            Assert.AreEqual(result.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 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");
        }