示例#1
0
        public async void CollectMultipleShows()
        {
            var client = new HttpClient {
                BaseAddress = new Uri("http://api.tvmaze.com/")
            };

            client.DefaultRequestHeaders.Add("Accept", "application/json");
            IShowCollector showCollector = new ShowCollector(client);
            var            result        = await showCollector.GetAllShowsAsync();

            Assert.True(result.Any());
        }
示例#2
0
        public async void CollectAllShowsCast()
        {
            var client = new HttpClient {
                BaseAddress = new Uri("http://api.tvmaze.com/")
            };

            client.DefaultRequestHeaders.Add("Accept", "application/json");
            IShowCollector showCollector = new ShowCollector(client);
            var            shows         = await showCollector.GetAllShowsAsync();

            foreach (var show in shows.Take(10)) // no need to collect them all
            {
                ICastCollector castCollector = new CastCollector(client);
                var            result        = await castCollector.GetCastAsync(show.Id);

                Assert.True(result.Any());
            }
        }