예제 #1
0
        public void Can_add_movie()
        {
            var newMovie = new Movie
               	{
               		Id = "tt0110912",
               		Title = "Pulp Fiction",
               		Rating = 8.9m,
               		Director = "Quentin Tarantino",
               		ReleaseDate = new DateTime(1994, 10, 24),
               		TagLine = "Girls like me don't make invitations like this to just anyone!",
               		Genres = new List<string> { "Crime", "Drama", "Thriller" },
               	};

            SendToEachEndpoint<MoviesResponse>(new Movies { Movie = newMovie }, HttpMethods.Put, null);

            SendToEachEndpoint<MoviesResponse>(new Movies { Id = newMovie.Id }, HttpMethods.Get, response =>
                Assert.That(newMovie.Equals(response.Movies[0]), Is.True)
            );
        }
예제 #2
0
 public bool Equals(Movie other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return Equals(other.Id, Id) && Equals(other.Title, Title) && other.Rating == Rating && Equals(other.Director, Director) && other.ReleaseDate.Equals(ReleaseDate) && Equals(other.TagLine, TagLine) && Genres.EquivalentTo(other.Genres);
 }