diff options
author | crupest <crupest@outlook.com> | 2021-02-08 21:24:42 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-02-08 21:24:42 +0800 |
commit | 45b683d582d4a7760ffd69c4cd47841ce0545119 (patch) | |
tree | 511e1ce84fa39a8fa4b122968ee836aa37d97678 /BackEnd/Timeline.Tests | |
parent | 8b7b570b008c9e9c8c0660c9650112d435269924 (diff) | |
download | timeline-45b683d582d4a7760ffd69c4cd47841ce0545119.tar.gz timeline-45b683d582d4a7760ffd69c4cd47841ce0545119.tar.bz2 timeline-45b683d582d4a7760ffd69c4cd47841ce0545119.zip |
...
Diffstat (limited to 'BackEnd/Timeline.Tests')
-rw-r--r-- | BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs b/BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs index b4ddcb43..17c85f22 100644 --- a/BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs +++ b/BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs @@ -535,5 +535,35 @@ namespace Timeline.Tests.IntegratedTests await client.TestGetAssertNotFoundAsync($"timelines/{generator(1)}/posts/{post.Id}");
}
+
+ [Theory]
+ [MemberData(nameof(TimelineNameGeneratorTestData))]
+ public async Task PatchPost(TimelineNameGenerator generator)
+ {
+ using var client = await CreateClientAsUser();
+
+ var post = await client.TestPostAsync<HttpTimelinePost>($"timelines/{generator(1)}/posts", new HttpTimelinePostCreateRequest
+ {
+ Content = new()
+ {
+ Type = "text",
+ Text = "aaa"
+ }
+ });
+
+ var date = new DateTime(2000, 10, 1);
+
+ var post2 = await client.TestPatchAsync<HttpTimelinePost>($"timelines/{generator(1)}/posts/{post.Id}", new HttpTimelinePostPatchRequest
+ {
+ Time = date,
+ Color = "#aabbcc"
+ });
+ post2.Time.Should().Be(date);
+ post2.Color.Should().Be("#aabbcc");
+
+ var post3 = await client.TestGetAsync<HttpTimelinePost>($"timelines/{generator(1)}/posts/{post.Id}");
+ post3.Time.Should().Be(date);
+ post3.Color.Should().Be("#aabbcc");
+ }
}
}
|