コード例 #1
0
        public void ConfigureRottenTomatoesData(IMovieCharacteristics movieCharacteristics)
        {
            var resultImdb = (movieCharacteristics.Ratings as List <string>).Find(x => x.Contains("RottenTomatoes"));
            var newRatings = new List <string>();

            newRatings.Add(resultImdb);
            movieCharacteristics.Ratings = newRatings;
        }
コード例 #2
0
 public IMovieCharacteristics GetData(IMovieCharacteristics movieCharacteristics)
 {
     Console.WriteLine("Getting Data from External REST API");
     movieCharacteristics.MovieName   = "The Dark Knight";
     movieCharacteristics.ReleaseDate = "2018";
     movieCharacteristics.Genre       = new List <string>();
     movieCharacteristics.Genre.Add("Drama");
     movieCharacteristics.Genre.Add("Thriller");
     movieCharacteristics.Ratings = new List <string>();
     movieCharacteristics.Ratings.Add("IMDB:9");
     movieCharacteristics.Ratings.Add("RottenTomatoes:94%");
     movieCharacteristics.Ratings.Add("MetaCritic:84%");
     Console.WriteLine("You have been charged 1$ for last API call.");
     return(movieCharacteristics);
 }
コード例 #3
0
 public void SendDataToRottenTomatoes(IMovieCharacteristics movieCharacteristics)
 {
     Console.WriteLine("Sending to RottenTomatoes data: " + movieCharacteristics);
 }
コード例 #4
0
 public void ConfigureGeneralGenre(IMovieCharacteristics movieCharacteristics)
 {
     movieCharacteristics.Genre.Add("SuperHero");
 }
コード例 #5
0
 public void SendDataToImdb(IMovieCharacteristics movieCharacteristics)
 {
     Console.WriteLine("Sending to IMDB data: " + movieCharacteristics);
 }