Exemple #1
0
        public void TestImagesResponseHandler()
        {
            var irh = new ImagesResponseHandler <Image>("https://www.wikipedia.org");
            var ir  = irh.RequestSingle("Google");

            Assert.IsNotNull(ir);
            Assert.IsInstanceOfType(ir, typeof(IEnumerable <IImage>));
            Assert.IsTrue(ir.Count > 0);
            Assert.IsNotNull(ir.First().Title);
            var irl = irh.RequestMany("Google", "Google Drive");

            Assert.IsNotNull(irl);
            Assert.IsInstanceOfType(irl, typeof(IEnumerable <IEnumerable <IImage> >));
        }
Exemple #2
0
        public IReadOnlyList <IImageInfoUrl> GetImageUrls(string pageTitle)
        {
            IReadOnlyList <IImage> images = imagesResponseHandler.RequestSingle(pageTitle);

            return(imageInfoResponseHandler.RequestMany(images.Select(x => x.Title).ToArray()));
        }