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