diff options
author | crupest <crupest@outlook.com> | 2021-01-31 15:42:52 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-01-31 15:42:52 +0800 |
commit | 7f88e120aba0f218641084aca4f467ffd27981d9 (patch) | |
tree | 54b320b4f236ae55895f32a64dbbc61d0022c835 /BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs | |
parent | 607460b87376be19d9117cdd7be11883410d8691 (diff) | |
download | timeline-7f88e120aba0f218641084aca4f467ffd27981d9.tar.gz timeline-7f88e120aba0f218641084aca4f467ffd27981d9.tar.bz2 timeline-7f88e120aba0f218641084aca4f467ffd27981d9.zip |
...
Diffstat (limited to 'BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs')
-rw-r--r-- | BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs b/BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs index 0060ac04..ae7afda1 100644 --- a/BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs +++ b/BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs @@ -124,6 +124,34 @@ namespace Timeline.Tests.IntegratedTests [Theory]
[MemberData(nameof(TimelineNameGeneratorTestData))]
+ public async Task Post_ModifiedSince_And_IncludeDeleted(TimelineNameGenerator generator)
+ {
+ using var client = await CreateClientAsUser();
+
+ var postContentList = new List<string> { "a", "b", "c", "d" };
+ var posts = new List<HttpTimelinePost>();
+
+ foreach (var (content, index) in postContentList.Select((v, i) => (v, i)))
+ {
+ var post = await client.TestPostAsync<HttpTimelinePost>($"timelines/{generator(1)}/posts",
+ new HttpTimelinePostCreateRequest { Content = new HttpTimelinePostCreateRequestContent { Text = content, Type = TimelinePostContentTypes.Text } });
+ posts.Add(post);
+ await Task.Delay(1000);
+ }
+
+ await client.TestDeleteAsync($"timelines/{generator(1)}/posts/{posts[2].Id}");
+
+ {
+
+ posts = await client.TestGetAsync<List<HttpTimelinePost>>($"timelines/{generator(1)}/posts?modifiedSince={posts[1].LastUpdated.ToString("s", CultureInfo.InvariantCulture)}&includeDeleted=true");
+ posts.Should().HaveCount(3);
+ posts.Select(p => p.Deleted).Should().Equal(false, true, false);
+ posts.Select(p => p.Content == null).Should().Equal(false, true, false);
+ }
+ }
+
+ [Theory]
+ [MemberData(nameof(TimelineNameGeneratorTestData))]
public async Task PostList_IncludeDeleted(TimelineNameGenerator generator)
{
using var client = await CreateClientAsUser();
|