aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-01-31 15:42:52 +0800
committercrupest <crupest@outlook.com>2021-01-31 15:42:52 +0800
commit415a91f08422a9a18958552ec21a25f336ef81c4 (patch)
tree629e3603b421f3e5c777de5974608be9ff9c485e /BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs
parent07ffcc6029158a2cee1e30250d0153dccccb13d0 (diff)
downloadtimeline-415a91f08422a9a18958552ec21a25f336ef81c4.tar.gz
timeline-415a91f08422a9a18958552ec21a25f336ef81c4.tar.bz2
timeline-415a91f08422a9a18958552ec21a25f336ef81c4.zip
...
Diffstat (limited to 'BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs')
-rw-r--r--BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs28
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();