diff options
author | crupest <crupest@outlook.com> | 2021-05-13 15:53:08 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-05-13 15:53:08 +0800 |
commit | 5b059ad031b87fc2e3beaf1b650fc365b34b86ba (patch) | |
tree | dd56141734ad3c97ae1a6c8e8a9b4f25ebabeca3 /BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs | |
parent | aea8e41def7eab0d4e9f339ff14143f5441ae71d (diff) | |
download | timeline-5b059ad031b87fc2e3beaf1b650fc365b34b86ba.tar.gz timeline-5b059ad031b87fc2e3beaf1b650fc365b34b86ba.tar.bz2 timeline-5b059ad031b87fc2e3beaf1b650fc365b34b86ba.zip |
feat: Posts pagination.
Diffstat (limited to 'BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs')
-rw-r--r-- | BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs b/BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs index c918f793..097275b0 100644 --- a/BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs +++ b/BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs @@ -634,5 +634,23 @@ namespace Timeline.Tests.IntegratedTests await client.TestDeleteAsync($"timelines/{generator(1)}/posts/{post.Id}");
}
}
+
+ [Theory]
+ [MemberData(nameof(TimelineNameGeneratorTestData))]
+ public async Task Post_List_Pagination_Test(TimelineNameGenerator generator)
+ {
+ using var client = await CreateClientAsUser();
+ var posts = new List<HttpTimelinePost>();
+ for (int i = 0; i < 50; i++)
+ {
+ var post = await client.TestPostAsync<HttpTimelinePost>($"timelines/{generator(1)}/posts", CreateTextPostRequest(i.ToString()));
+ posts.Add(post);
+ }
+
+ {
+ var p = await client.TestGetAsync<List<HttpTimelinePost>>($"timelines/{generator(1)}/posts?page=2&numberPerPage=10");
+ p.Should().BeEquivalentTo(posts.Skip(10).Take(10));
+ }
+ }
}
}
|