Пример #1
0
        public void AddMovieTest()
        {
            List<Actor> actors = new List<Actor>();
            Director director = new Director();
            Studio studio = new Studio();

            var movie = new MovieInfo();

            //movie.MovieID = 20;
            //movie.MpaaRating.FilmRating = "PG-13";
            movie.MpaaRating.MpaaRatingID = 7;
            movie.Title = "Inception";

            var actor = new Actor();
            actor.ActorID = 6;
            //actor.FirstName = "Will";
            //actor.LastName = "Smith";

            actors.Add(actor);

            movie.Actors = actors;
            movie.Director.DirectorID = 13;
            //movie.Director.FirstName = "Oliver";
            //movie.Director.LastName = "Queen";
            movie.ReleaseDate = 2002;
            movie.Studio.StudioID = 10;
            //movie.Studio.StudioName = "Robot";

            _response = _ops.AddMovie(movie);

            var responseReturned = _ops.GetMovieByID(_response.Movie.MovieID);

            var actual = new JavaScriptSerializer().Serialize(_response.Movie);
            var expected = new JavaScriptSerializer().Serialize(responseReturned.Movie);

            //Assert.AreEqual(expected, actual);
               Assert.AreEqual(true, _response.Success );
        }
Пример #2
0
        public void GetAllDirectors()
        {
            _response = _ops.GetAllDirectors();

            Assert.AreEqual(true, _response.Success);
        }
Пример #3
0
        public void GetAllBorrowers()
        {
            _response = _ops.GetAllBorrowers();

            Assert.AreEqual(true, _response.Success);
        }
Пример #4
0
 public void Setup()
 {
     _ops = new MovieOperations();
     _response = new Response();
 }
Пример #5
0
        public void TrackDVDTest()
        {
            _response = _ops.TrackDvd(2);

            Assert.AreEqual(true,  _response.Success );
        }
Пример #6
0
        public void RemoveMovieTest()
        {
            _response = _ops.RemoveMovie(18);

            Assert.AreEqual(0, _response.Movie.MovieID);
        }
Пример #7
0
        public void GetBorrowerByID()
        {
            _response = _ops.GetBorrowerByID(1);

            Assert.AreEqual(true, _response.Success);
        }
Пример #8
0
        public void GetAllStudios()
        {
            _response = _ops.GetAllStudios();

                Assert.AreEqual(true, _response.Success);
        }
Пример #9
0
        public void GetAllMpaaRatings()
        {
            _response = _ops.GetAllMpaaRatings();

            Assert.AreEqual(true, _response.Success);
        }
Пример #10
0
        public void GetAllMoviesTest()
        {
            _response = _ops.GetAllMovies();
            //var _response = movieRepo.GetAllMovieInfo();

            Assert.AreEqual(true, _response.Success);
        }