Exemplo n.º 1
0
        static HtmlEmitFormatedTest()
        {
            movie               = new Movie();
            movie.Id            = 11;
            movie.Budget        = 11000000;
            movie.OriginalTitle = "Star Wars";
            movie.TagLine       = "A long time ago in a galaxy far, far away...";
            movie.Overview      = "Princess Leia is captured and held hostage by the evil Imperial forces in their effort to take over the galactic Empire. Venturesome Luke Skywalker and dashing captain Han Solo team together with the loveable robot duo R2-D2 and C-3PO to rescue the beautiful princess and restore peace and justice in the Empire.";
            movie.VoteAverage   = (float)8.1;
            movie.PosterPath    = "/btTdmkgIvOi0FFip1sPuZI2oQG6.jpg";
            movie.ReleaseDate   = "1977-05-25";
            movies              = new MovieSearchItem[1];
            MovieSearchItem item = new MovieSearchItem();

            item.Id               = 11;
            item.ReleaseDate      = "1977-05-25";
            item.Title            = "Star Wars";
            item.VoteAverage      = (float)8.1;
            movies[0]             = item;
            expected              = new Person();
            expected.Id           = 2;
            expected.Name         = "Mark Hamill";
            expected.Birthday     = "1951-09-25";
            expected.Deathday     = null;
            expected.PlaceOfBirth = "Concord, California, USA";
            expected.Biography    = "From Wikipedia, the free encyclopedia.\n\nMark Richard Hamill (born September 25, 1951) is an American actor, voice artist, producer, director, and writer. Hamill is best known for his role as Luke Skywalker in the original Star Wars trilogy and also well known for voice-acting characters such as the Joker in various animated series, animated films and video games, beginning with Batman: The Animated Series, the Skeleton king in Super Robot Monkey Team Hyperforce Go!, Fire Lord Ozai in Avatar: The Last Airbender, Master Eraqus in Kingdom Hearts: Birth by Sleep, Skips in Regular Show, and Senator Stampington on Metalocalypse.\n\nDescription above from the Wikipedia article Mark Hamill, licensed under CC-BY-SA, full list of contributors on Wikipedia .";
            expected.ProfilePath  = "/ws544EgE5POxGJqq9LUfhnDrHtV.jpg";
        }
Exemplo n.º 2
0
 static void Print(MovieSearchItem movie)
 {
     System.Console.WriteLine();
     System.Console.WriteLine($"Movie:    {movie.Title} / {movie.Rating * 10}");
     System.Console.WriteLine("Cast: " + string.Join(", ", movie.Cast.Select(p => p.Name)));
     System.Console.WriteLine(movie.Summary);
 }
Exemplo n.º 3
0
        public void testPersonCredits()
        {
            MovieSearchItem[] testArray = new MovieSearchItem[3];
            TheMovieDbClient  client    = new TheMovieDbClient();

            testArray = client.PersonMovies(3489);
            Assert.AreEqual("Ann Darrow", testArray[0].Character);
            Assert.AreEqual("King Kong", testArray[0].Original_title);
            Assert.AreEqual("2005-12-14", testArray[0].Release_date);
            Assert.AreEqual(6.6, testArray[0].Vote_average);
        }
Exemplo n.º 4
0
 static BenchHtmlectVsHtmlectEmit()
 {
     for (int i = 0; i < PAGES_TO_BENCH; i++)
     {
         MovieSearchItem[] querryItems = movieDb.Search("world", 1);
         MovieSearchItem[] newSample   = new MovieSearchItem[querryItems.Length + sampleArray.Length];
         querryItems.CopyTo(newSample, 0);
         sampleArray.CopyTo(newSample, querryItems.Length);
         sampleArray = newSample;
     }
 }
Exemplo n.º 5
0
        public void SearchTest()
        {
            MovieSearchItem expected = new MovieSearchItem();

            expected.Id          = 181808;
            expected.Title       = "Star Wars: The Last Jedi";
            expected.ReleaseDate = "2017-12-13";
            MovieSearchItem[] actual = new TheMovieDbClient().Search("Star Wars", 1);
            Assert.AreEqual(expected.Id, actual[0].Id);
            Assert.AreEqual(expected.Title, actual[0].Title);
            Assert.AreEqual(expected.ReleaseDate, actual[0].ReleaseDate);
        }
Exemplo n.º 6
0
 private static void CreateMovieSearchArray(int numberOfElem)
 {
     movieSearch = new MovieSearchItem[numberOfElem];
     for (int i = 0; i < numberOfElem; i++)
     {
         MovieSearchItem m = new MovieSearchItem();
         m.Id           = 1;
         m.ReleaseDate  = "someDate";
         m.Title        = "SomeTitle";
         m.VoteAverage  = 7.7;
         movieSearch[i] = m;
     }
 }
Exemplo n.º 7
0
        static HtmlectTest()
        {
            movie               = new Movie();
            movie.Id            = 11;
            movie.Budget        = 11000000;
            movie.OriginalTitle = "Star Wars";
            movie.TagLine       = "A long time ago in a galaxy far, far away...";
            movie.Overview      = "Princess Leia is captured and held hostage by the evil Imperial forces in their effort to take over the galactic Empire. Venturesome Luke Skywalker and dashing captain Han Solo team together with the loveable robot duo R2-D2 and C-3PO to rescue the beautiful princess and restore peace and justice in the Empire.";
            movie.VoteAverage   = (float)8.1;
            movie.PosterPath    = "/btTdmkgIvOi0FFip1sPuZI2oQG6.jpg";
            movie.ReleaseDate   = "1977-05-25";
            movies              = new MovieSearchItem[1];
            MovieSearchItem item = new MovieSearchItem();

            item.Id          = 11;
            item.ReleaseDate = "1977-05-25";
            item.Title       = "Star Wars";
            item.VoteAverage = (float)8.1;
            movies[0]        = item;
        }