Esempio n. 1
0
        public void TestGetEpisodeByEpisodeIdBad()
        {
            var omdb = new OmdbClient(TestData.apikey);

            Assert.Throws <ArgumentException>(() => omdb.GetEpisodeByEpisodeId(null));
            Assert.Throws <ArgumentException>(() => omdb.GetEpisodeByEpisodeId(""));
            Assert.Throws <ArgumentException>(() => omdb.GetEpisodeByEpisodeId(" "));

            Assert.Throws <HttpRequestException>(() => omdb.GetEpisodeByEpisodeId("asdf"));
        }
Esempio n. 2
0
        public void TestGetEpisodeByEpisodeIdGood()
        {
            var omdb    = new OmdbClient(TestData.apikey);
            var episode = omdb.GetEpisodeByEpisodeId("tt2340185");


            var ratings = episode.Ratings.ToArray();

            Assert.Equal("Internet Movie Database", ratings[0].Source);

            Assert.Equal("Pilot", episode.Title);
            Assert.Equal("2012", episode.Year);
            Assert.Equal("TV-PG", episode.Rated);
            Assert.Equal("10 Oct 2012", episode.Released);
            Assert.Equal("1", episode.SeasonNumber);
            Assert.Equal("1", episode.EpisodeNumber);
            Assert.Equal("45 min", episode.Runtime);
            Assert.Equal("David Nutter", episode.Director);
            Assert.Equal("English", episode.Language);
            Assert.Equal("USA, Canada", episode.Country);
            Assert.Equal("tt2340185", episode.ImdbId);
            Assert.Equal("tt2193021", episode.SeriesId);
            Assert.Equal("episode", episode.Type);
            Assert.Equal("True", episode.Response);
        }