extract images from article in Reader

This commit is contained in:
2013-12-16 21:42:11 +01:00
parent 6e6cef138a
commit 996755ef50
7 changed files with 184 additions and 101 deletions
+18
View File
@@ -39,6 +39,24 @@ namespace PocketSharp.Tests
}
[Fact]
public async Task ReadArticleWithImagesTest()
{
PocketArticle result = await reader.Read(new Uri("https://hacks.mozilla.org/2013/12/application-layout-with-css3-flexible-box-module/"));
Assert.True(result.Images.Count >= 3);
Assert.True(result.Images[0].Uri.ToString().StartsWith("https://hacks.mozilla.org"));
Assert.True(result.Images[1].Uri.ToString().EndsWith(".gif"));
}
[Fact]
public async Task ReadArticleWithNoImagesTest()
{
PocketArticle result = await reader.Read(new Uri("http://getpocket.com/hits/awards/2013/"));
Assert.True(result.Images == null || result.Images.Count < 1);
}
[Fact]
public async Task ReadArticleWithInvalidUriTest()
{