|
|
@ -24,6 +24,7 @@ Future main() async { |
|
|
|
folderId: folderID, |
|
|
|
folderId: folderID, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
cleanResponse: true, |
|
|
|
))!; |
|
|
|
))!; |
|
|
|
|
|
|
|
|
|
|
|
Future<NewsListFeeds> addNasaFeed() async => (await validateResponse<NewsListFeeds, void>( |
|
|
|
Future<NewsListFeeds> addNasaFeed() async => (await validateResponse<NewsListFeeds, void>( |
|
|
@ -31,6 +32,7 @@ Future main() async { |
|
|
|
client.news.addFeedWithHttpInfo( |
|
|
|
client.news.addFeedWithHttpInfo( |
|
|
|
NewsAddFeed(url: nasaFeedURL), |
|
|
|
NewsAddFeed(url: nasaFeedURL), |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
cleanResponse: true, |
|
|
|
))!; |
|
|
|
))!; |
|
|
|
|
|
|
|
|
|
|
|
test('Add feed', () async { |
|
|
|
test('Add feed', () async { |
|
|
@ -51,6 +53,7 @@ Future main() async { |
|
|
|
response = (await validateResponse<NewsListFeeds, void>( |
|
|
|
response = (await validateResponse<NewsListFeeds, void>( |
|
|
|
client.news, |
|
|
|
client.news, |
|
|
|
client.news.listFeedsWithHttpInfo(), |
|
|
|
client.news.listFeedsWithHttpInfo(), |
|
|
|
|
|
|
|
cleanResponse: true, |
|
|
|
))!; |
|
|
|
))!; |
|
|
|
expect(response.starredCount, 0); |
|
|
|
expect(response.starredCount, 0); |
|
|
|
expect(response.newestItemId, isNotNull); |
|
|
|
expect(response.newestItemId, isNotNull); |
|
|
@ -64,6 +67,7 @@ Future main() async { |
|
|
|
var articlesResponse = (await validateResponse<NewsListArticles, void>( |
|
|
|
var articlesResponse = (await validateResponse<NewsListArticles, void>( |
|
|
|
client.news, |
|
|
|
client.news, |
|
|
|
client.news.listArticlesWithHttpInfo(type: 6), |
|
|
|
client.news.listArticlesWithHttpInfo(type: 6), |
|
|
|
|
|
|
|
cleanResponse: true, |
|
|
|
))!; |
|
|
|
))!; |
|
|
|
expect(articlesResponse.items.length, greaterThan(0)); |
|
|
|
expect(articlesResponse.items.length, greaterThan(0)); |
|
|
|
|
|
|
|
|
|
|
@ -77,6 +81,7 @@ Future main() async { |
|
|
|
articlesResponse = (await validateResponse<NewsListArticles, void>( |
|
|
|
articlesResponse = (await validateResponse<NewsListArticles, void>( |
|
|
|
client.news, |
|
|
|
client.news, |
|
|
|
client.news.listArticlesWithHttpInfo(type: 6), |
|
|
|
client.news.listArticlesWithHttpInfo(type: 6), |
|
|
|
|
|
|
|
cleanResponse: true, |
|
|
|
))!; |
|
|
|
))!; |
|
|
|
expect(articlesResponse.items, hasLength(0)); |
|
|
|
expect(articlesResponse.items, hasLength(0)); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -85,6 +90,7 @@ Future main() async { |
|
|
|
var response = (await validateResponse<NewsListArticles, void>( |
|
|
|
var response = (await validateResponse<NewsListArticles, void>( |
|
|
|
client.news, |
|
|
|
client.news, |
|
|
|
client.news.listArticlesWithHttpInfo(), |
|
|
|
client.news.listArticlesWithHttpInfo(), |
|
|
|
|
|
|
|
cleanResponse: true, |
|
|
|
))!; |
|
|
|
))!; |
|
|
|
expect(response.items, hasLength(0)); |
|
|
|
expect(response.items, hasLength(0)); |
|
|
|
|
|
|
|
|
|
|
@ -93,6 +99,7 @@ Future main() async { |
|
|
|
response = (await validateResponse<NewsListArticles, void>( |
|
|
|
response = (await validateResponse<NewsListArticles, void>( |
|
|
|
client.news, |
|
|
|
client.news, |
|
|
|
client.news.listArticlesWithHttpInfo(), |
|
|
|
client.news.listArticlesWithHttpInfo(), |
|
|
|
|
|
|
|
cleanResponse: true, |
|
|
|
))!; |
|
|
|
))!; |
|
|
|
expect(response.items.length, greaterThan(0)); |
|
|
|
expect(response.items.length, greaterThan(0)); |
|
|
|
expect(response.items[0].body, isNotNull); |
|
|
|
expect(response.items[0].body, isNotNull); |
|
|
@ -112,6 +119,7 @@ Future main() async { |
|
|
|
var response = (await validateResponse<NewsListArticles, void>( |
|
|
|
var response = (await validateResponse<NewsListArticles, void>( |
|
|
|
client.news, |
|
|
|
client.news, |
|
|
|
client.news.listArticlesWithHttpInfo(), |
|
|
|
client.news.listArticlesWithHttpInfo(), |
|
|
|
|
|
|
|
cleanResponse: true, |
|
|
|
))!; |
|
|
|
))!; |
|
|
|
final wikipediaArticles = response.items.length; |
|
|
|
final wikipediaArticles = response.items.length; |
|
|
|
expect(wikipediaArticles, greaterThan(0)); |
|
|
|
expect(wikipediaArticles, greaterThan(0)); |
|
|
@ -121,6 +129,7 @@ Future main() async { |
|
|
|
response = (await validateResponse<NewsListArticles, void>( |
|
|
|
response = (await validateResponse<NewsListArticles, void>( |
|
|
|
client.news, |
|
|
|
client.news, |
|
|
|
client.news.listArticlesWithHttpInfo(), |
|
|
|
client.news.listArticlesWithHttpInfo(), |
|
|
|
|
|
|
|
cleanResponse: true, |
|
|
|
))!; |
|
|
|
))!; |
|
|
|
final nasaArticles = response.items.length - wikipediaArticles; |
|
|
|
final nasaArticles = response.items.length - wikipediaArticles; |
|
|
|
expect(nasaArticles, greaterThan(0)); |
|
|
|
expect(nasaArticles, greaterThan(0)); |
|
|
@ -130,6 +139,7 @@ Future main() async { |
|
|
|
client.news.listUpdatedArticlesWithHttpInfo( |
|
|
|
client.news.listUpdatedArticlesWithHttpInfo( |
|
|
|
lastModified: response.items[response.items.length - 1 - nasaArticles].lastModified, |
|
|
|
lastModified: response.items[response.items.length - 1 - nasaArticles].lastModified, |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
cleanResponse: true, |
|
|
|
))!; |
|
|
|
))!; |
|
|
|
expect(response.items, hasLength(nasaArticles)); |
|
|
|
expect(response.items, hasLength(nasaArticles)); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -140,6 +150,7 @@ Future main() async { |
|
|
|
var response = (await validateResponse<NewsListArticles, void>( |
|
|
|
var response = (await validateResponse<NewsListArticles, void>( |
|
|
|
client.news, |
|
|
|
client.news, |
|
|
|
client.news.listArticlesWithHttpInfo(type: 6), |
|
|
|
client.news.listArticlesWithHttpInfo(type: 6), |
|
|
|
|
|
|
|
cleanResponse: true, |
|
|
|
))!; |
|
|
|
))!; |
|
|
|
final unreadArticles = response.items.length; |
|
|
|
final unreadArticles = response.items.length; |
|
|
|
expect(unreadArticles, greaterThan(0)); |
|
|
|
expect(unreadArticles, greaterThan(0)); |
|
|
@ -148,6 +159,7 @@ Future main() async { |
|
|
|
response = (await validateResponse<NewsListArticles, void>( |
|
|
|
response = (await validateResponse<NewsListArticles, void>( |
|
|
|
client.news, |
|
|
|
client.news, |
|
|
|
client.news.listArticlesWithHttpInfo(type: 6), |
|
|
|
client.news.listArticlesWithHttpInfo(type: 6), |
|
|
|
|
|
|
|
cleanResponse: true, |
|
|
|
))!; |
|
|
|
))!; |
|
|
|
expect(response.items, hasLength(unreadArticles - 1)); |
|
|
|
expect(response.items, hasLength(unreadArticles - 1)); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -158,12 +170,14 @@ Future main() async { |
|
|
|
var response = (await validateResponse<NewsListArticles, void>( |
|
|
|
var response = (await validateResponse<NewsListArticles, void>( |
|
|
|
client.news, |
|
|
|
client.news, |
|
|
|
client.news.listArticlesWithHttpInfo(type: 6), |
|
|
|
client.news.listArticlesWithHttpInfo(type: 6), |
|
|
|
|
|
|
|
cleanResponse: true, |
|
|
|
))!; |
|
|
|
))!; |
|
|
|
final readArticle = response.items[0]; |
|
|
|
final readArticle = response.items[0]; |
|
|
|
await client.news.markArticleAsRead(readArticle.id!); |
|
|
|
await client.news.markArticleAsRead(readArticle.id!); |
|
|
|
response = (await validateResponse<NewsListArticles, void>( |
|
|
|
response = (await validateResponse<NewsListArticles, void>( |
|
|
|
client.news, |
|
|
|
client.news, |
|
|
|
client.news.listArticlesWithHttpInfo(type: 6), |
|
|
|
client.news.listArticlesWithHttpInfo(type: 6), |
|
|
|
|
|
|
|
cleanResponse: true, |
|
|
|
))!; |
|
|
|
))!; |
|
|
|
final unreadArticles = response.items.length; |
|
|
|
final unreadArticles = response.items.length; |
|
|
|
expect(unreadArticles, greaterThan(0)); |
|
|
|
expect(unreadArticles, greaterThan(0)); |
|
|
@ -172,6 +186,7 @@ Future main() async { |
|
|
|
response = (await validateResponse<NewsListArticles, void>( |
|
|
|
response = (await validateResponse<NewsListArticles, void>( |
|
|
|
client.news, |
|
|
|
client.news, |
|
|
|
client.news.listArticlesWithHttpInfo(type: 6), |
|
|
|
client.news.listArticlesWithHttpInfo(type: 6), |
|
|
|
|
|
|
|
cleanResponse: true, |
|
|
|
))!; |
|
|
|
))!; |
|
|
|
expect(response.items, hasLength(unreadArticles + 1)); |
|
|
|
expect(response.items, hasLength(unreadArticles + 1)); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -182,6 +197,7 @@ Future main() async { |
|
|
|
var response = (await validateResponse<NewsListArticles, void>( |
|
|
|
var response = (await validateResponse<NewsListArticles, void>( |
|
|
|
client.news, |
|
|
|
client.news, |
|
|
|
client.news.listArticlesWithHttpInfo(type: 2), |
|
|
|
client.news.listArticlesWithHttpInfo(type: 2), |
|
|
|
|
|
|
|
cleanResponse: true, |
|
|
|
))!; |
|
|
|
))!; |
|
|
|
final starredArticles = response.items.length; |
|
|
|
final starredArticles = response.items.length; |
|
|
|
expect(starredArticles, 0); |
|
|
|
expect(starredArticles, 0); |
|
|
@ -189,11 +205,13 @@ Future main() async { |
|
|
|
response = (await validateResponse<NewsListArticles, void>( |
|
|
|
response = (await validateResponse<NewsListArticles, void>( |
|
|
|
client.news, |
|
|
|
client.news, |
|
|
|
client.news.listArticlesWithHttpInfo(), |
|
|
|
client.news.listArticlesWithHttpInfo(), |
|
|
|
|
|
|
|
cleanResponse: true, |
|
|
|
))!; |
|
|
|
))!; |
|
|
|
await client.news.starArticle(response.items[0].feedId!, response.items[0].guidHash!); |
|
|
|
await client.news.starArticle(response.items[0].feedId!, response.items[0].guidHash!); |
|
|
|
response = (await validateResponse<NewsListArticles, void>( |
|
|
|
response = (await validateResponse<NewsListArticles, void>( |
|
|
|
client.news, |
|
|
|
client.news, |
|
|
|
client.news.listArticlesWithHttpInfo(type: 2), |
|
|
|
client.news.listArticlesWithHttpInfo(type: 2), |
|
|
|
|
|
|
|
cleanResponse: true, |
|
|
|
))!; |
|
|
|
))!; |
|
|
|
expect(response.items, hasLength(1)); |
|
|
|
expect(response.items, hasLength(1)); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -204,6 +222,7 @@ Future main() async { |
|
|
|
var response = (await validateResponse<NewsListArticles, void>( |
|
|
|
var response = (await validateResponse<NewsListArticles, void>( |
|
|
|
client.news, |
|
|
|
client.news, |
|
|
|
client.news.listArticlesWithHttpInfo(), |
|
|
|
client.news.listArticlesWithHttpInfo(), |
|
|
|
|
|
|
|
cleanResponse: true, |
|
|
|
))!; |
|
|
|
))!; |
|
|
|
final item = response.items[0]; |
|
|
|
final item = response.items[0]; |
|
|
|
|
|
|
|
|
|
|
@ -211,6 +230,7 @@ Future main() async { |
|
|
|
response = (await validateResponse<NewsListArticles, void>( |
|
|
|
response = (await validateResponse<NewsListArticles, void>( |
|
|
|
client.news, |
|
|
|
client.news, |
|
|
|
client.news.listArticlesWithHttpInfo(type: 2), |
|
|
|
client.news.listArticlesWithHttpInfo(type: 2), |
|
|
|
|
|
|
|
cleanResponse: true, |
|
|
|
))!; |
|
|
|
))!; |
|
|
|
expect(response.items, hasLength(1)); |
|
|
|
expect(response.items, hasLength(1)); |
|
|
|
|
|
|
|
|
|
|
@ -218,6 +238,7 @@ Future main() async { |
|
|
|
response = (await validateResponse<NewsListArticles, void>( |
|
|
|
response = (await validateResponse<NewsListArticles, void>( |
|
|
|
client.news, |
|
|
|
client.news, |
|
|
|
client.news.listArticlesWithHttpInfo(type: 2), |
|
|
|
client.news.listArticlesWithHttpInfo(type: 2), |
|
|
|
|
|
|
|
cleanResponse: true, |
|
|
|
))!; |
|
|
|
))!; |
|
|
|
expect(response.items, hasLength(0)); |
|
|
|
expect(response.items, hasLength(0)); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -295,6 +316,7 @@ Future main() async { |
|
|
|
var articlesResponse = (await validateResponse<NewsListArticles, void>( |
|
|
|
var articlesResponse = (await validateResponse<NewsListArticles, void>( |
|
|
|
client.news, |
|
|
|
client.news, |
|
|
|
client.news.listArticlesWithHttpInfo(type: 6), |
|
|
|
client.news.listArticlesWithHttpInfo(type: 6), |
|
|
|
|
|
|
|
cleanResponse: true, |
|
|
|
))!; |
|
|
|
))!; |
|
|
|
expect(articlesResponse.items.length, greaterThan(0)); |
|
|
|
expect(articlesResponse.items.length, greaterThan(0)); |
|
|
|
|
|
|
|
|
|
|
@ -308,6 +330,7 @@ Future main() async { |
|
|
|
articlesResponse = (await validateResponse<NewsListArticles, void>( |
|
|
|
articlesResponse = (await validateResponse<NewsListArticles, void>( |
|
|
|
client.news, |
|
|
|
client.news, |
|
|
|
client.news.listArticlesWithHttpInfo(type: 6), |
|
|
|
client.news.listArticlesWithHttpInfo(type: 6), |
|
|
|
|
|
|
|
cleanResponse: true, |
|
|
|
))!; |
|
|
|
))!; |
|
|
|
expect(articlesResponse.items, hasLength(0)); |
|
|
|
expect(articlesResponse.items, hasLength(0)); |
|
|
|
}); |
|
|
|
}); |
|
|
|