public MovieInfo() { Actors = new List<Actor>(); MpaaRating = new MpaaRating(); Director = new Director(); Studio = new Studio(); ActorIDs = new List<int>(); }
public Movie() { Genres = new List<Genre>(); Director = new Director(); Studio = new Studio(); MovieActors = new List<Actor>(); MovieAliases = new List<MovieAlias>(); UserRatings = new List<UserRating>(); UserNotes = new List<UserNote>(); }
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 ); }
public void AddMovieWithInputTest() { 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.Title = "Inception"; var actor = new Actor(); //a.ActorID = 10; actor.FirstName = "Will"; actor.LastName = "Smith"; actors.Add(actor); movie.Actors = actors; //movie.Director.DirectorID = 10; movie.Director.FirstName = "Oliver"; movie.Director.LastName = "Queen"; movie.ReleaseDate = 2002; //movie.Studio.StudioID = 10; movie.Studio.StudioName = "Robot"; MovieInfo movieinfo = _repo.AddMovie(movie); var movieReturned = _repo.GetMovieByID(movieinfo.MovieID); var actual = new JavaScriptSerializer().Serialize(movieReturned); var expected = new JavaScriptSerializer().Serialize(movieinfo); Assert.AreEqual(expected, actual); //Assert.AreEqual("Inception", movieinfo.Title); }