add article suggestions

This commit is contained in:
2018-07-03 12:20:16 +02:00
parent 8248f90b5b
commit 281034a16d
5 changed files with 78 additions and 25 deletions
+27 -16
View File
@@ -33,23 +33,34 @@ namespace PocketSharp.Tests
Assert.True(item.Uri == itemDuplicate.Uri);
}
// [Fact]
// public async Task IsItemJsonPopulated()
// {
// List<PocketItem> items = (await client.Get()).ToList();
// string schemaJson = @"{
// 'description': 'PocketItem',
// 'type': 'object'
// }";
// JsonSchema schema = JsonSchema.Parse(schemaJson);
// foreach (var pocketItem in items)
// {
// Assert.True(!string.IsNullOrWhiteSpace(pocketItem.Json));
// var jObject = JObject.Parse(pocketItem.Json);
// Assert.True(jObject.IsValid(schema));
// }
// }
[Fact]
public async Task AreSuggestionsRetrieved()
{
var articles = await client.GetTrendingArticles();
string itemId = articles.First().ID;
List<PocketItem> suggestions = (await client.GetSuggestions(itemId)).ToList();
Assert.True(suggestions.Count > 0);
}
// [Fact]
// public async Task IsItemJsonPopulated()
// {
// List<PocketItem> items = (await client.Get()).ToList();
// string schemaJson = @"{
// 'description': 'PocketItem',
// 'type': 'object'
// }";
// JsonSchema schema = JsonSchema.Parse(schemaJson);
// foreach (var pocketItem in items)
// {
// Assert.True(!string.IsNullOrWhiteSpace(pocketItem.Json));
// var jObject = JObject.Parse(pocketItem.Json);
// Assert.True(jObject.IsValid(schema));
// }
// }
[Fact]
public async Task AreFilteredItemsRetrieved()
+2 -6
View File
@@ -10,9 +10,7 @@ namespace PocketSharp.Tests
[Fact]
public async Task AreTrendingArticlesReturned()
{
string guid = await client.GetGuid();
var articles = await client.GetTrendingArticles(guid);
var articles = await client.GetTrendingArticles();
Assert.NotEmpty(articles);
}
@@ -20,9 +18,7 @@ namespace PocketSharp.Tests
[Fact]
public async Task AreTrendingTopicsReturned()
{
string guid = await client.GetGuid();
var topics = await client.GetTrendingTopics(guid);
var topics = await client.GetTrendingTopics();
Assert.NotEmpty(topics);
}
}