Remove PocketSharp.Reader => moved to ReadSharp

See https://github.com/ceee/ReadSharp if you want to use ReadSharp
This commit is contained in:
2013-12-19 11:24:22 +01:00
parent 3201160d66
commit 25bb5028a5
45 changed files with 8 additions and 12360 deletions
@@ -77,15 +77,10 @@
<Compile Include="ModifyTests.cs" />
<Compile Include="GetTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ReadTests.cs" />
<Compile Include="StressTests.cs" />
<Compile Include="TestsBase.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PocketSharp.Reader\PocketSharp.Reader.csproj">
<Project>{9d1bbd72-c263-43d3-9f2a-98f9f99235a4}</Project>
<Name>PocketSharp.Reader</Name>
</ProjectReference>
<ProjectReference Include="..\PocketSharp\PocketSharp.csproj">
<Project>{817200c3-a327-4e35-9b5f-63a51c088577}</Project>
<Name>PocketSharp</Name>
-78
View File
@@ -1,78 +0,0 @@
using PocketSharp.Models;
using System;
using System.Threading.Tasks;
using Xunit;
namespace PocketSharp.Tests
{
public class ReadTests : TestsBase
{
private PocketReader reader;
public ReadTests()
: base()
{
reader = new PocketReader();
}
[Fact]
public async Task ReadArticleTest()
{
PocketArticle result = await reader.Read(new Uri("http://frontendplay.com/story/4/http-caching-demystified-part-2-implementation"));
Assert.DoesNotContain("<!DOCTYPE html>", result.Content);
Assert.Contains("<h1>", result.Content);
Assert.True(result.Content.Length > 15000);
}
[Fact]
public async Task ReadArticleWithContainerNoHeadlineTest()
{
PocketArticle result = await reader.Read(new Uri("http://frontendplay.com/story/4/http-caching-demystified-part-2-implementation"), false, true);
Assert.Contains("<!DOCTYPE html>", result.Content);
Assert.DoesNotContain("<h1>", result.Content);
Assert.True(result.Content.Length > 15000);
}
[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()
{
await ThrowsAsync<PocketException>(async () =>
{
await reader.Read(new Uri("http://frontendplayyyyy.com"));
});
}
[Fact]
public async Task IsBodyOnlyProperlyResolved()
{
PocketArticle result = await reader.Read(new Uri("http://calebjacob.com/tooltipster/"));
Assert.True(result.Content.Substring(0, 4) == "<div");
}
}
}